Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/extensions/extension_install_ui.cc

Issue 7601014: browser: Abstract message box dialog functions into its own header file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile on linux_view? Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_install_ui.h" 5 #include "chrome/browser/extensions/extension_install_ui.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/string_util.h" 12 #include "base/string_util.h"
13 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
14 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
15 #include "chrome/browser/extensions/extension_install_dialog.h" 15 #include "chrome/browser/extensions/extension_install_dialog.h"
16 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" 16 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h"
17 #include "chrome/browser/platform_util.h"
18 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/simple_message_box.h"
19 #include "chrome/browser/tabs/tab_strip_model.h" 19 #include "chrome/browser/tabs/tab_strip_model.h"
20 #include "chrome/browser/themes/theme_service.h" 20 #include "chrome/browser/themes/theme_service.h"
21 #include "chrome/browser/themes/theme_service_factory.h" 21 #include "chrome/browser/themes/theme_service_factory.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_dialogs.h" 23 #include "chrome/browser/ui/browser_dialogs.h"
24 #include "chrome/browser/ui/browser_list.h" 24 #include "chrome/browser/ui/browser_list.h"
25 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 26 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
27 #include "chrome/common/chrome_notification_types.h" 27 #include "chrome/common/chrome_notification_types.h"
28 #include "chrome/common/chrome_switches.h" 28 #include "chrome/common/chrome_switches.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 bool disable_failure_ui_for_tests = false; 198 bool disable_failure_ui_for_tests = false;
199 199
200 } // namespace 200 } // namespace
201 201
202 void ExtensionInstallUI::OnInstallFailure(const std::string& error) { 202 void ExtensionInstallUI::OnInstallFailure(const std::string& error) {
203 DCHECK(ui_loop_ == MessageLoop::current()); 203 DCHECK(ui_loop_ == MessageLoop::current());
204 204
205 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); 205 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_);
206 if (disable_failure_ui_for_tests) 206 if (disable_failure_ui_for_tests)
207 return; 207 return;
208 platform_util::SimpleErrorBox( 208 browser::ShowErrorBox(
209 browser ? browser->window()->GetNativeHandle() : NULL, 209 browser ? browser->window()->GetNativeHandle() : NULL,
210 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE), 210 l10n_util::GetStringUTF16(IDS_EXTENSION_INSTALL_FAILURE_TITLE),
211 UTF8ToUTF16(error)); 211 UTF8ToUTF16(error));
212 } 212 }
213 213
214 void ExtensionInstallUI::SetIcon(SkBitmap* image) { 214 void ExtensionInstallUI::SetIcon(SkBitmap* image) {
215 if (image) 215 if (image)
216 icon_ = *image; 216 icon_ = *image;
217 else 217 else
218 icon_ = SkBitmap(); 218 icon_ = SkBitmap();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate( 318 InfoBarDelegate* ExtensionInstallUI::GetNewThemeInstalledInfoBarDelegate(
319 TabContents* tab_contents, 319 TabContents* tab_contents,
320 const Extension* new_theme, 320 const Extension* new_theme,
321 const std::string& previous_theme_id, 321 const std::string& previous_theme_id,
322 bool previous_using_native_theme) { 322 bool previous_using_native_theme) {
323 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, 323 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme,
324 previous_theme_id, 324 previous_theme_id,
325 previous_using_native_theme); 325 previous_using_native_theme);
326 } 326 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_reporter.cc ('k') | chrome/browser/extensions/file_manager_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698