diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 18:18:54 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-07 18:18:54 +0000 |
commit | 7ff431eff426668988f79fb2cb23b6ae3a0ef7d1 (patch) | |
tree | 905ace285a09e9f51a4182a37b56fdaa8a524ab6 /chrome/browser/renderer_preferences_util.cc | |
parent | e97831dd75f59483cca12b7cb397bdbc0e945cd4 (diff) | |
download | chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.zip chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.tar.gz chromium_src-7ff431eff426668988f79fb2cb23b6ae3a0ef7d1.tar.bz2 |
Only calculate the GTK scrollbar colors once and then update all RenderPreferences on theme change.
BUG=10949
TEST=none
Review URL: http://codereview.chromium.org/525016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_preferences_util.cc')
-rw-r--r-- | chrome/browser/renderer_preferences_util.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc index d3ef9a4..de9f711 100644 --- a/chrome/browser/renderer_preferences_util.cc +++ b/chrome/browser/renderer_preferences_util.cc @@ -4,7 +4,6 @@ #include "chrome/browser/renderer_preferences_util.h" -#include "base/singleton.h" #include "chrome/browser/profile.h" #if defined(OS_LINUX) @@ -14,17 +13,19 @@ namespace renderer_preferences_util { -RendererPreferences GetInitedRendererPreferences(Profile* profile) { - RendererPreferences* prefs = Singleton<RendererPreferences>::get(); +void UpdateFromSystemSettings(RendererPreferences* prefs, Profile* profile) { #if defined(OS_LINUX) - static bool inited = false; - if (!inited) { - gtk_util::InitRendererPrefsFromGtkSettings(prefs, - GtkThemeProvider::GetFrom(profile)->UseGtkTheme()); - inited = true; - } -#endif - return *prefs; + gtk_util::UpdateGtkFontSettings(prefs); + +#if !defined(TOOLKIT_VIEWS) + GtkThemeProvider* provider = GtkThemeProvider::GetFrom(profile); + + prefs->focus_ring_color = provider->get_focus_ring_color(); + prefs->thumb_active_color = provider->get_thumb_active_color(); + prefs->thumb_inactive_color = provider->get_thumb_inactive_color(); + prefs->track_color = provider->get_track_color(); +#endif // !defined(TOOLKIT_VIEWS) +#endif // defined(OS_LINUX) } } // renderer_preferences_util |