Home | History | Annotate | Download | only in ui
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "chrome/browser/ui/profile_error_dialog.h"
      6 
      7 #include "chrome/browser/platform_util.h"
      8 #include "chrome/browser/ui/browser.h"
      9 #include "chrome/browser/ui/browser_list.h"
     10 #include "chrome/browser/ui/browser_window.h"
     11 #include "grit/chromium_strings.h"
     12 #include "grit/generated_resources.h"
     13 #include "ui/base/l10n/l10n_util.h"
     14 
     15 void ShowProfileErrorDialog(int message_id) {
     16   // Parent the dialog to the current browser. During startup there may be no
     17   // browser.
     18   Browser* browser = BrowserList::GetLastActive();
     19   platform_util::SimpleErrorBox(
     20       browser ? browser->window()->GetNativeHandle() : NULL,
     21       l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
     22       l10n_util::GetStringUTF16(message_id));
     23 }
     24