summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_preferences_util.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 20:11:39 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-09 20:11:39 +0000
commitefba8d707b56c019f6d1d13a22285d0a39850fa4 (patch)
tree217f2161c2b9d3674d445500f4171f9d4ffe6ccd /chrome/browser/renderer_preferences_util.cc
parent5cd4d0d559ea23eb56604bae8de670e2c663c1f7 (diff)
downloadchromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.zip
chromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.tar.gz
chromium_src-efba8d707b56c019f6d1d13a22285d0a39850fa4.tar.bz2
linux: theme scrollbars from GTK theme
Pick the color of the slider's thumbpart and rail from the GTK theme. We cannot match the exact visual appearance of the GTK theme, as rendering engines can make arbitrary changes to the actual visual appearance. But by sampling a representative set of pixels, we ensure that we will at least match the general color scheme. BUG=10949 patch by <markus [at] chromium> original review: http://codereview.chromium.org/400027/show Review URL: http://codereview.chromium.org/466080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34183 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_preferences_util.cc')
-rw-r--r--chrome/browser/renderer_preferences_util.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
new file mode 100644
index 0000000..d3ef9a4
--- /dev/null
+++ b/chrome/browser/renderer_preferences_util.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/renderer_preferences_util.h"
+
+#include "base/singleton.h"
+#include "chrome/browser/profile.h"
+
+#if defined(OS_LINUX)
+#include "chrome/browser/gtk/gtk_theme_provider.h"
+#include "chrome/common/gtk_util.h"
+#endif
+
+namespace renderer_preferences_util {
+
+RendererPreferences GetInitedRendererPreferences(Profile* profile) {
+ RendererPreferences* prefs = Singleton<RendererPreferences>::get();
+#if defined(OS_LINUX)
+ static bool inited = false;
+ if (!inited) {
+ gtk_util::InitRendererPrefsFromGtkSettings(prefs,
+ GtkThemeProvider::GetFrom(profile)->UseGtkTheme());
+ inited = true;
+ }
+#endif
+ return *prefs;
+}
+
+} // renderer_preferences_util