summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/profile_error_dialog.cc
blob: 0f17878634547b08c5313af8c2494fc0681c62ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/profile_error_dialog.h"

#include "chrome/browser/simple_message_box.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"

void ShowProfileErrorDialog(int message_id) {
  // Parent the dialog to the current browser. During startup there may be no
  // browser.
  Browser* browser = BrowserList::GetLastActive();
  browser::ShowErrorBox(
      browser ? browser->window()->GetNativeHandle() : NULL,
      l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
      l10n_util::GetStringUTF16(message_id));
}