Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/browser_list.h" | 15 #include "chrome/browser/browser_list.h" |
| 16 #include "chrome/browser/browser_window.h" | 16 #include "chrome/browser/browser_window.h" |
| 17 #include "chrome/browser/extensions/extension_install_dialog.h" | |
| 18 #include "chrome/browser/extensions/extension_install_dialog2.h" | 17 #include "chrome/browser/extensions/extension_install_dialog2.h" |
| 19 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" | 18 #include "chrome/browser/extensions/theme_installed_infobar_delegate.h" |
| 20 #include "chrome/browser/platform_util.h" | 19 #include "chrome/browser/platform_util.h" |
| 21 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 22 #include "chrome/browser/tabs/tab_strip_model.h" | 21 #include "chrome/browser/tabs/tab_strip_model.h" |
| 23 #include "chrome/browser/themes/theme_service.h" | 22 #include "chrome/browser/themes/theme_service.h" |
| 24 #include "chrome/browser/ui/browser.h" | 23 #include "chrome/browser/ui/browser.h" |
| 25 #include "chrome/browser/ui/browser_dialogs.h" | 24 #include "chrome/browser/ui/browser_dialogs.h" |
| 26 #include "chrome/common/extensions/extension.h" | 25 #include "chrome/common/extensions/extension.h" |
| 27 #include "chrome/common/extensions/extension_icon_set.h" | 26 #include "chrome/common/extensions/extension_icon_set.h" |
| 28 #include "chrome/common/extensions/extension_resource.h" | 27 #include "chrome/common/extensions/extension_resource.h" |
| 29 #include "chrome/common/extensions/url_pattern.h" | 28 #include "chrome/common/extensions/url_pattern.h" |
| 30 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 31 #include "content/browser/tab_contents/tab_contents.h" | 30 #include "content/browser/tab_contents/tab_contents.h" |
| 32 #include "content/common/notification_service.h" | 31 #include "content/common/notification_service.h" |
| 33 #include "grit/chromium_strings.h" | 32 #include "grit/chromium_strings.h" |
| 34 #include "grit/generated_resources.h" | 33 #include "grit/generated_resources.h" |
| 35 #include "grit/theme_resources.h" | 34 #include "grit/theme_resources.h" |
| 36 #include "ui/base/l10n/l10n_util.h" | 35 #include "ui/base/l10n/l10n_util.h" |
| 37 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
| 38 | 37 |
| 39 #if defined(TOOLKIT_GTK) | 38 #if defined(TOOLKIT_GTK) |
| 40 #include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" | 39 #include "chrome/browser/extensions/gtk_theme_installed_infobar_delegate.h" |
| 41 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" | 40 #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
| 42 #endif | 41 #endif |
| 43 | 42 |
| 44 // static | 43 // static |
| 45 const int ExtensionInstallUI::kTitleIds[NUM_PROMPT_TYPES] = { | 44 const int ExtensionInstallUI::kTitleIds[NUM_PROMPT_TYPES] = { |
|
Aaron Boodman
2011/03/23 21:06:54
You should remove all the things that got moved to
tfarina
2011/03/23 21:12:06
I can't because extension_install_prompt2_gtk.cc a
| |
| 46 IDS_EXTENSION_INSTALL_PROMPT_TITLE, | 45 IDS_EXTENSION_INSTALL_PROMPT_TITLE, |
| 47 IDS_EXTENSION_UNINSTALL_PROMPT_TITLE, | 46 IDS_EXTENSION_UNINSTALL_PROMPT_TITLE, |
| 48 IDS_EXTENSION_RE_ENABLE_PROMPT_TITLE | 47 IDS_EXTENSION_RE_ENABLE_PROMPT_TITLE |
| 49 }; | 48 }; |
| 50 // static | 49 // static |
| 51 const int ExtensionInstallUI::kHeadingIds[NUM_PROMPT_TYPES] = { | 50 const int ExtensionInstallUI::kHeadingIds[NUM_PROMPT_TYPES] = { |
| 52 IDS_EXTENSION_INSTALL_PROMPT_HEADING, | 51 IDS_EXTENSION_INSTALL_PROMPT_HEADING, |
| 53 IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, | 52 IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, |
| 54 IDS_EXTENSION_RE_ENABLE_PROMPT_HEADING | 53 IDS_EXTENSION_RE_ENABLE_PROMPT_HEADING |
| 55 }; | 54 }; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 NotificationService* service = NotificationService::current(); | 222 NotificationService* service = NotificationService::current(); |
| 224 service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, | 223 service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG, |
| 225 Source<ExtensionInstallUI>(this), | 224 Source<ExtensionInstallUI>(this), |
| 226 NotificationService::NoDetails()); | 225 NotificationService::NoDetails()); |
| 227 | 226 |
| 228 std::vector<string16> warnings = extension_->GetPermissionMessages(); | 227 std::vector<string16> warnings = extension_->GetPermissionMessages(); |
| 229 ShowExtensionInstallDialog2( | 228 ShowExtensionInstallDialog2( |
| 230 profile_, delegate_, extension_, &icon_, warnings, prompt_type_); | 229 profile_, delegate_, extension_, &icon_, warnings, prompt_type_); |
| 231 break; | 230 break; |
| 232 } | 231 } |
| 233 case UNINSTALL_PROMPT: { | |
| 234 ShowExtensionInstallDialog( | |
| 235 profile_, delegate_, extension_, &icon_, UNINSTALL_PROMPT); | |
| 236 break; | |
| 237 } | |
| 238 default: | 232 default: |
| 239 NOTREACHED() << "Unknown message"; | 233 NOTREACHED() << "Unknown message"; |
| 240 break; | 234 break; |
| 241 } | 235 } |
| 242 } | 236 } |
| 243 | 237 |
| 244 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, | 238 void ExtensionInstallUI::ShowThemeInfoBar(const std::string& previous_theme_id, |
| 245 bool previous_use_system_theme, | 239 bool previous_use_system_theme, |
| 246 const Extension* new_theme, | 240 const Extension* new_theme, |
| 247 Profile* profile) { | 241 Profile* profile) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 const std::string& previous_theme_id, | 297 const std::string& previous_theme_id, |
| 304 bool previous_use_system_theme) { | 298 bool previous_use_system_theme) { |
| 305 #if defined(TOOLKIT_GTK) | 299 #if defined(TOOLKIT_GTK) |
| 306 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 300 return new GtkThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 307 previous_theme_id, previous_use_system_theme); | 301 previous_theme_id, previous_use_system_theme); |
| 308 #else | 302 #else |
| 309 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, | 303 return new ThemeInstalledInfoBarDelegate(tab_contents, new_theme, |
| 310 previous_theme_id); | 304 previous_theme_id); |
| 311 #endif | 305 #endif |
| 312 } | 306 } |
| OLD | NEW |