diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 23:15:13 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 23:15:13 +0000 |
commit | f5a723719c2df2ba09915e6afcf1d54c5e445fa0 (patch) | |
tree | 415e0f5e9e8840e5e5212e4cab4f1dfcae29967a /chrome/browser/extensions/extension_install_ui.h | |
parent | 5e7a6bc9cca84dc5554ce9f145f83871972c0725 (diff) | |
download | chromium_src-f5a723719c2df2ba09915e6afcf1d54c5e445fa0.zip chromium_src-f5a723719c2df2ba09915e6afcf1d54c5e445fa0.tar.gz chromium_src-f5a723719c2df2ba09915e6afcf1d54c5e445fa0.tar.bz2 |
Show Infobar on new synced theme even if the theme was already
installed (but not loaded).
Refactored theme handling code in ExtensionInstallerUI.
BUG=40847
TEST=manual
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=44134
Review URL: http://codereview.chromium.org/1625007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_ui.h')
-rwxr-xr-x | chrome/browser/extensions/extension_install_ui.h | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h index 822060d..1fb4b87 100755 --- a/chrome/browser/extensions/extension_install_ui.h +++ b/chrome/browser/extensions/extension_install_ui.h @@ -89,11 +89,17 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { virtual void OnImageLoaded( SkBitmap* image, ExtensionResource resource, int index); - private: - // When a Theme is downloaded it is applied and an info bar is shown to give - // the user a choice to keep it or undo the installation. - void ShowThemeInfoBar(Extension* new_theme); + // Show an infobar for a newly-installed theme. previous_theme_id + // should be empty if the previous theme was the system/default + // theme. + // + // TODO(akalin): Find a better home for this (and + // GetNewThemeInstalledInfoBarDelegate()). + static void ShowThemeInfoBar( + const std::string& previous_theme_id, bool previous_use_system_theme, + Extension* new_theme, Profile* profile); + private: // Starts the process of showing a confirmation UI, which is split into two. // 1) Set off a 'load icon' task. // 2) Handle the load icon response and show the UI (OnImageLoaded). @@ -105,10 +111,11 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { void ShowGenericExtensionInstalledInfoBar(Extension* new_extension); #endif - // Returns the delegate to control the browser's info bar. This is within its - // own function due to its platform-specific nature. - InfoBarDelegate* GetNewInfoBarDelegate(Extension* new_theme, - TabContents* tab_contents); + // Returns the delegate to control the browser's info bar. This is + // within its own function due to its platform-specific nature. + static InfoBarDelegate* GetNewThemeInstalledInfoBarDelegate( + TabContents* tab_contents, Extension* new_theme, + const std::string& previous_theme_id, bool previous_use_system_theme); // Implements the showing of the install/uninstall dialog prompt. // NOTE: The implementations of this function is platform-specific. @@ -124,7 +131,11 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { Profile* profile_; MessageLoop* ui_loop_; - std::string previous_theme_id_; // Used to undo theme installation. + + // Used to undo theme installation. + std::string previous_theme_id_; + bool previous_use_system_theme_; + SkBitmap icon_; // The extensions installation icon. Extension* extension_; // The extension we are showing the UI for. Delegate* delegate_; // The delegate we will call Proceed/Abort on after @@ -134,11 +145,6 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer { // Keeps track of extension images being loaded on the File thread for the // purpose of showing the install UI. ImageLoadingTracker tracker_; - -#if defined(TOOLKIT_GTK) - // Also needed to undo theme installation in the Linux UI. - bool previous_use_gtk_theme_; -#endif }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INSTALL_UI_H_ |