summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/gtk_theme_provider.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 18:18:54 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 18:18:54 +0000
commit7ff431eff426668988f79fb2cb23b6ae3a0ef7d1 (patch)
tree905ace285a09e9f51a4182a37b56fdaa8a524ab6 /chrome/browser/gtk/gtk_theme_provider.h
parente97831dd75f59483cca12b7cb397bdbc0e945cd4 (diff)
downloadchromium_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/gtk/gtk_theme_provider.h')
-rw-r--r--chrome/browser/gtk/gtk_theme_provider.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/chrome/browser/gtk/gtk_theme_provider.h b/chrome/browser/gtk/gtk_theme_provider.h
index 44fed99..87e3fe2 100644
--- a/chrome/browser/gtk/gtk_theme_provider.h
+++ b/chrome/browser/gtk/gtk_theme_provider.h
@@ -72,8 +72,7 @@ class GtkThemeProvider : public BrowserThemeProvider,
// Used when rendering scrollbars.
static void GetScrollbarColors(GdkColor* thumb_active_color,
GdkColor* thumb_inactive_color,
- GdkColor* track_color,
- bool use_gtk_theme);
+ GdkColor* track_color);
// Expose the inner label. Only used for testing.
GtkWidget* fake_label() { return fake_label_.get(); }
@@ -83,9 +82,16 @@ class GtkThemeProvider : public BrowserThemeProvider,
// to send the image to the server on each expose.
CairoCachedSurface* GetSurfaceNamed(int id, GtkWidget* widget_on_display);
- // These functions do not add a ref to the returned pixbuf, and it should not be
- // unreffed.
- // If |native| is true, get the GTK_STOCK version of the icon.
+ // Returns colors that we pass to webkit to match the system theme.
+ const SkColor& get_focus_ring_color() const { return focus_ring_color_; }
+ const SkColor& get_thumb_active_color() const { return thumb_active_color_; }
+ const SkColor& get_thumb_inactive_color() const {
+ return thumb_inactive_color_;
+ }
+ const SkColor& get_track_color() const { return track_color_; }
+
+ // These functions do not add a ref to the returned pixbuf, and it should not
+ // be unreffed. If |native| is true, get the GTK_STOCK version of the icon.
static GdkPixbuf* GetFolderIcon(bool native);
static GdkPixbuf* GetDefaultFavicon(bool native);
@@ -108,8 +114,13 @@ class GtkThemeProvider : public BrowserThemeProvider,
GtkStyle* previous_style,
GtkThemeProvider* provider);
+ // Extracts colors and tints from the GTK theme, both for the
+ // BrowserThemeProvider interface and the colors we send to webkit.
void LoadGtkValues();
+ // Sets the values that we send to webkit to safe defaults.
+ void LoadDefaultValues();
+
// Sets the underlying theme colors/tints from a GTK color.
void SetThemeColorFromGtk(int id, GdkColor* color);
void SetThemeTintFromGtk(int id, GdkColor* color);
@@ -154,6 +165,13 @@ class GtkThemeProvider : public BrowserThemeProvider,
ColorMap colors_;
TintMap tints_;
+ // Colors that we pass to WebKit. These are generated each time the theme
+ // changes.
+ SkColor focus_ring_color_;
+ SkColor thumb_active_color_;
+ SkColor thumb_inactive_color_;
+ SkColor track_color_;
+
// Image cache of lazily created images, created when requested by
// GetBitmapNamed().
mutable ImageCache gtk_images_;