Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4094)

Unified Diff: chrome/browser/renderer_preferences_util.cc

Issue 525016: Update RenderPreferences on GTK change. (Closed)
Patch Set: style nit Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/renderer_preferences_util.h ('k') | chrome/browser/tab_contents/interstitial_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_preferences_util.cc
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
index d3ef9a4d1f4e0455fcf0594d348d04bca0b28165..de9f711101e3ed56a2c6fc7c4d3d19d3e2e761c1 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
« no previous file with comments | « chrome/browser/renderer_preferences_util.h ('k') | chrome/browser/tab_contents/interstitial_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698