summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 22:17:00 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-26 22:17:00 +0000
commit0dc1f496cd4ddd8a55f6e5d12d0b7ee38411239f (patch)
tree41adf5df7a87bd62594ca35792280ef7f5d0f815 /chrome/browser/gtk
parentf7c157d90329d1e5d90f6dab31d4981b6ac9d489 (diff)
downloadchromium_src-0dc1f496cd4ddd8a55f6e5d12d0b7ee38411239f.zip
chromium_src-0dc1f496cd4ddd8a55f6e5d12d0b7ee38411239f.tar.gz
chromium_src-0dc1f496cd4ddd8a55f6e5d12d0b7ee38411239f.tar.bz2
Fix startup regression in gtk theme mode.
Don't populate the image dictionary in gtk mode, in addition to not writing the images to disk. Review URL: http://codereview.chromium.org/173525 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.cc15
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.h4
2 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/gtk/gtk_theme_provider.cc b/chrome/browser/gtk/gtk_theme_provider.cc
index aa8d7ae..fecff2e 100644
--- a/chrome/browser/gtk/gtk_theme_provider.cc
+++ b/chrome/browser/gtk/gtk_theme_provider.cc
@@ -200,6 +200,17 @@ SkBitmap* GtkThemeProvider::LoadThemeBitmap(int id) {
}
}
+void GtkThemeProvider::SaveThemeBitmap(const std::string resource_name,
+ int id) {
+ if (!use_gtk_) {
+ // Prevent us from writing out our mostly unused resources in gtk theme
+ // mode. Simply preventing us from writing this data out in gtk mode isn't
+ // the best design, but this would probably be a very invasive change on
+ // all three platforms otherwise.
+ BrowserThemeProvider::SaveThemeBitmap(resource_name, id);
+ }
+}
+
// static
void GtkThemeProvider::OnStyleSet(GtkWidget* widget,
GtkStyle* previous_style,
@@ -215,7 +226,9 @@ void GtkThemeProvider::LoadGtkValues() {
// Before we start setting images and values, we have to clear out old, stale
// values. (If we don't do this, we'll regress startup time in the case where
// someone installs a heavyweight theme, then goes back to GTK.)
- profile()->GetPrefs()->ClearPref(prefs::kCurrentThemeImages);
+ DictionaryValue* pref_images =
+ profile()->GetPrefs()->GetMutableDictionary(prefs::kCurrentThemeImages);
+ pref_images->Clear();
GtkStyle* window_style = gtk_rc_get_style(fake_window_);
GtkStyle* label_style = gtk_rc_get_style(fake_label_.get());
diff --git a/chrome/browser/gtk/gtk_theme_provider.h b/chrome/browser/gtk/gtk_theme_provider.h
index dbffe57..be160e5 100644
--- a/chrome/browser/gtk/gtk_theme_provider.h
+++ b/chrome/browser/gtk/gtk_theme_provider.h
@@ -75,6 +75,10 @@ class GtkThemeProvider : public BrowserThemeProvider,
// engines.)
virtual SkBitmap* LoadThemeBitmap(int id);
+ // If use_gtk_ is true, completely ignores this call. Otherwise passes it to
+ // the superclass.
+ virtual void SaveThemeBitmap(const std::string resource_name, int id);
+
// Handles signal from GTK that our theme has been changed.
static void OnStyleSet(GtkWidget* widget,
GtkStyle* previous_style,