From 5973945e4c3d2baf2b92d11be55c1692a09b12e3 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Fri, 11 Dec 2009 20:55:30 +0000 Subject: Completely redo how themes are stored on disk and processed at install time. Rewrites most of BrowserThemeProvider and adds a new class BrowserThemePack. BrowserThemePack takes all the logic of generating resources out of the BrowserThemeProvider, does all of them at theme install time (previously, we lazily generated all the button images and a good number of colors, which muddled logic quite a bit), and then writes all the data out into an mmap()able file to speed startup when a theme is installed. In addition, this changes how the GtkThemeProvider works. The GtkThemeProvider now generates all of its images lazily and doesn't reach into the implementation details of BrowserThemeProvider as it used to. BUG=24493,21121 TEST=All the new unit tests pass. All the complex theme startup tests go faster. Review URL: http://codereview.chromium.org/460050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34379 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/theme_installed_infobar_delegate.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'chrome/browser/extensions/theme_installed_infobar_delegate.cc') diff --git a/chrome/browser/extensions/theme_installed_infobar_delegate.cc b/chrome/browser/extensions/theme_installed_infobar_delegate.cc index 879cbb2..caea07d 100644 --- a/chrome/browser/extensions/theme_installed_infobar_delegate.cc +++ b/chrome/browser/extensions/theme_installed_infobar_delegate.cc @@ -27,7 +27,9 @@ ThemeInstalledInfoBarDelegate::ThemeInstalledInfoBarDelegate( void ThemeInstalledInfoBarDelegate::InfoBarClosed() { ExtensionsService* service = profile_->GetExtensionsService(); - if (service) { + // Only delete the theme if we've installed a new theme and not the same + // theme on top of the current one. + if (service && previous_theme_id_ != new_theme_id_) { std::string uninstall_id; if (was_canceled_) uninstall_id = new_theme_id_; -- cgit v1.1