diff options
author | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 17:32:27 +0000 |
---|---|---|
committer | tony@chromium.org <tony@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-29 17:32:27 +0000 |
commit | 6de9d86c4d3a610ddc9520a32d9969dbe445867e (patch) | |
tree | 945c665c4d0773027d37a91aabedc9a0f03de641 /chrome/browser/extensions/theme_installed_infobar_delegate.h | |
parent | 4e1c6b2efb7d40ebc99ec7448503f7652212ddf6 (diff) | |
download | chromium_src-6de9d86c4d3a610ddc9520a32d9969dbe445867e.zip chromium_src-6de9d86c4d3a610ddc9520a32d9969dbe445867e.tar.gz chromium_src-6de9d86c4d3a610ddc9520a32d9969dbe445867e.tar.bz2 |
Uninstall themes after the undo infobar goes away.
We don't hold a pointer to the Extension in ThemeInstalledInfobarDelegate because it can become invalid. Instead we use the id to uninstall if the extension exists at infobar close time.
Also keep the code for deleting themes on shutdown to clean up old users and because a crash could leave themes hanging around.
BUG=25832
Review URL: http://codereview.chromium.org/343027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/theme_installed_infobar_delegate.h')
-rw-r--r-- | chrome/browser/extensions/theme_installed_infobar_delegate.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.h b/chrome/browser/extensions/theme_installed_infobar_delegate.h index 594764a..90c25a5 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.h +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.h @@ -7,6 +7,7 @@ #include "chrome/browser/tab_contents/infobar_delegate.h" +class Extension; class SkBitmap; class TabContents; @@ -15,8 +16,8 @@ class TabContents; class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate { public: ThemeInstalledInfoBarDelegate(TabContents* tab_contents, - const std::string& name, - const std::string& previous_theme); + const Extension* new_theme, + const std::string& previous_theme_id); virtual void InfoBarClosed(); virtual std::wstring GetMessageText() const; virtual SkBitmap* GetIcon() const; @@ -29,10 +30,17 @@ class ThemeInstalledInfoBarDelegate : public ConfirmInfoBarDelegate { protected: Profile* profile() { return profile_; } + // Keeps track of whether we canceled the install or not. + bool was_canceled_; + private: Profile* profile_; - std::string name_; // name of theme to install - std::string previous_theme_id_; // used to undo theme install + // Name of theme that's just been installed. + std::string name_; + // Id of theme that's just been installed. + std::string new_theme_id_; + // Used to undo theme install. + std::string previous_theme_id_; }; #endif // CHROME_BROWSER_VIEWS_EXTENSIONS_THEME_INSTALLED_INFOBAR_DELEGATE_H_ |