summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_install_ui.cc
diff options
context:
space:
mode:
authortessamac@google.com <tessamac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 00:00:53 +0000
committertessamac@google.com <tessamac@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-07 00:00:53 +0000
commit047b4b5470ad1b7888c96c9314af78f41a87f387 (patch)
treefaf2407c53d93b85b1a1786a006e4b95704581ce /chrome/browser/extensions/extension_install_ui.cc
parent34222dbf38e3d05faadb4e14b0aa85633c0205a6 (diff)
downloadchromium_src-047b4b5470ad1b7888c96c9314af78f41a87f387.zip
chromium_src-047b4b5470ad1b7888c96c9314af78f41a87f387.tar.gz
chromium_src-047b4b5470ad1b7888c96c9314af78f41a87f387.tar.bz2
Store previous theme in ExtensionInstallUI constructor (rather than ConfirmInstall) to ensure it always happens.
BUG=65867 TEST=ui_tests and interactive_ui_tests and browser_tests Review URL: http://codereview.chromium.org/6092009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_ui.cc')
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index 391a54c..18013e0 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -77,7 +77,22 @@ ExtensionInstallUI::ExtensionInstallUI(Profile* profile)
extension_(NULL),
delegate_(NULL),
prompt_type_(NUM_PROMPT_TYPES),
- ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {}
+ ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
+ // Remember the current theme in case the user presses undo.
+ if (profile_) {
+ const Extension* previous_theme = profile_->GetTheme();
+ if (previous_theme)
+ previous_theme_id_ = previous_theme->id();
+#if defined(TOOLKIT_GTK)
+ // On Linux, we also need to take the user's system settings into account
+ // to undo theme installation.
+ previous_use_system_theme_ =
+ GtkThemeProvider::GetFrom(profile_)->UseGtkTheme();
+#else
+ DCHECK(!previous_use_system_theme_);
+#endif
+ }
+}
ExtensionInstallUI::~ExtensionInstallUI() {
}
@@ -92,20 +107,6 @@ void ExtensionInstallUI::ConfirmInstall(Delegate* delegate,
// immediately installed, and then we show an infobar (see OnInstallSuccess)
// to allow the user to revert if they don't like it.
if (extension->is_theme()) {
- // Remember the current theme in case the user pressed undo.
- const Extension* previous_theme = profile_->GetTheme();
- if (previous_theme)
- previous_theme_id_ = previous_theme->id();
-
-#if defined(TOOLKIT_GTK)
- // On Linux, we also need to take the user's system settings into account
- // to undo theme installation.
- previous_use_system_theme_ =
- GtkThemeProvider::GetFrom(profile_)->UseGtkTheme();
-#else
- DCHECK(!previous_use_system_theme_);
-#endif
-
delegate->InstallUIProceed();
return;
}