| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
| 15 #include "chrome/browser/browser_window.h" | 15 #include "chrome/browser/browser_window.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/profile.h" | 17 #include "chrome/browser/profile.h" |
| 18 #include "chrome/browser/tab_contents/tab_contents.h" | 18 #include "chrome/browser/tab_contents/tab_contents.h" |
| 19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 20 #include "grit/browser_resources.h" | 20 #include "grit/browser_resources.h" |
| 21 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 23 #include "grit/theme_resources.h" |
| 23 | 24 |
| 24 #if defined(TOOLKIT_GTK) | 25 #if defined(TOOLKIT_GTK) |
| 25 #include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" | 26 #include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" |
| 26 #include "chrome/browser/gtk/gtk_theme_provider.h" | 27 #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 namespace { | 30 namespace { |
| 30 | 31 |
| 31 static std::wstring GetInstallWarning(Extension* extension) { | 32 static std::wstring GetInstallWarning(Extension* extension) { |
| 32 // If the extension has a plugin, it's easy: the plugin has the most severe | 33 // If the extension has a plugin, it's easy: the plugin has the most severe |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 previous_use_gtk_theme_ = | 103 previous_use_gtk_theme_ = |
| 103 GtkThemeProvider::GetFrom(profile_)->UseGtkTheme(); | 104 GtkThemeProvider::GetFrom(profile_)->UseGtkTheme(); |
| 104 #endif | 105 #endif |
| 105 | 106 |
| 106 delegate->ContinueInstall(); | 107 delegate->ContinueInstall(); |
| 107 return; | 108 return; |
| 108 } | 109 } |
| 109 | 110 |
| 110 if (!install_icon) { | 111 if (!install_icon) { |
| 111 install_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 112 install_icon = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 112 IDR_DEFAULT_EXTENSION_ICON_128); | 113 IDR_EXTENSIONS_SECTION); |
| 113 } | 114 } |
| 114 | 115 |
| 115 ShowExtensionInstallPrompt(profile_, delegate, extension, install_icon, | 116 ShowExtensionInstallPrompt(profile_, delegate, extension, install_icon, |
| 116 GetInstallWarning(extension)); | 117 GetInstallWarning(extension)); |
| 117 | 118 |
| 118 } | 119 } |
| 119 | 120 |
| 120 void ExtensionInstallUI::OnInstallSuccess(Extension* extension) { | 121 void ExtensionInstallUI::OnInstallSuccess(Extension* extension) { |
| 121 ShowThemeInfoBar(extension); | 122 ShowThemeInfoBar(extension); |
| 122 } | 123 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 InfoBarDelegate* ExtensionInstallUI::GetNewInfoBarDelegate( | 167 InfoBarDelegate* ExtensionInstallUI::GetNewInfoBarDelegate( |
| 167 Extension* new_theme, TabContents* tab_contents) { | 168 Extension* new_theme, TabContents* tab_contents) { |
| 168 #if defined(TOOLKIT_GTK) | 169 #if defined(TOOLKIT_GTK) |
| 169 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme->name(), | 170 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme->name(), |
| 170 previous_theme_id_, previous_use_gtk_theme_); | 171 previous_theme_id_, previous_use_gtk_theme_); |
| 171 #else | 172 #else |
| 172 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme->name(), | 173 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme->name(), |
| 173 previous_theme_id_); | 174 previous_theme_id_); |
| 174 #endif | 175 #endif |
| 175 } | 176 } |
| OLD | NEW |