OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ |
6 #define CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ | 6 #define CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // to send the image to the server on each expose. | 82 // to send the image to the server on each expose. |
83 CairoCachedSurface* GetSurfaceNamed(int id, GtkWidget* widget_on_display); | 83 CairoCachedSurface* GetSurfaceNamed(int id, GtkWidget* widget_on_display); |
84 | 84 |
85 // Returns colors that we pass to webkit to match the system theme. | 85 // Returns colors that we pass to webkit to match the system theme. |
86 const SkColor& get_focus_ring_color() const { return focus_ring_color_; } | 86 const SkColor& get_focus_ring_color() const { return focus_ring_color_; } |
87 const SkColor& get_thumb_active_color() const { return thumb_active_color_; } | 87 const SkColor& get_thumb_active_color() const { return thumb_active_color_; } |
88 const SkColor& get_thumb_inactive_color() const { | 88 const SkColor& get_thumb_inactive_color() const { |
89 return thumb_inactive_color_; | 89 return thumb_inactive_color_; |
90 } | 90 } |
91 const SkColor& get_track_color() const { return track_color_; } | 91 const SkColor& get_track_color() const { return track_color_; } |
| 92 const SkColor& get_active_selection_bg_color() const { |
| 93 return active_selection_bg_color_; |
| 94 } |
| 95 const SkColor& get_active_selection_fg_color() const { |
| 96 return active_selection_fg_color_; |
| 97 } |
| 98 const SkColor& get_inactive_selection_bg_color() const { |
| 99 return inactive_selection_bg_color_; |
| 100 } |
| 101 const SkColor& get_inactive_selection_fg_color() const { |
| 102 return inactive_selection_fg_color_; |
| 103 } |
92 | 104 |
93 // These functions do not add a ref to the returned pixbuf, and it should not | 105 // These functions do not add a ref to the returned pixbuf, and it should not |
94 // be unreffed. If |native| is true, get the GTK_STOCK version of the icon. | 106 // be unreffed. If |native| is true, get the GTK_STOCK version of the icon. |
95 static GdkPixbuf* GetFolderIcon(bool native); | 107 static GdkPixbuf* GetFolderIcon(bool native); |
96 static GdkPixbuf* GetDefaultFavicon(bool native); | 108 static GdkPixbuf* GetDefaultFavicon(bool native); |
97 | 109 |
98 private: | 110 private: |
99 typedef std::map<int, SkColor> ColorMap; | 111 typedef std::map<int, SkColor> ColorMap; |
100 typedef std::map<int, color_utils::HSL> TintMap; | 112 typedef std::map<int, color_utils::HSL> TintMap; |
101 typedef std::map<int, SkBitmap*> ImageCache; | 113 typedef std::map<int, SkBitmap*> ImageCache; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // caller while |use_gtk_| is true. | 180 // caller while |use_gtk_| is true. |
169 ColorMap colors_; | 181 ColorMap colors_; |
170 TintMap tints_; | 182 TintMap tints_; |
171 | 183 |
172 // Colors that we pass to WebKit. These are generated each time the theme | 184 // Colors that we pass to WebKit. These are generated each time the theme |
173 // changes. | 185 // changes. |
174 SkColor focus_ring_color_; | 186 SkColor focus_ring_color_; |
175 SkColor thumb_active_color_; | 187 SkColor thumb_active_color_; |
176 SkColor thumb_inactive_color_; | 188 SkColor thumb_inactive_color_; |
177 SkColor track_color_; | 189 SkColor track_color_; |
| 190 SkColor active_selection_bg_color_; |
| 191 SkColor active_selection_fg_color_; |
| 192 SkColor inactive_selection_bg_color_; |
| 193 SkColor inactive_selection_fg_color_; |
178 | 194 |
179 // Image cache of lazily created images, created when requested by | 195 // Image cache of lazily created images, created when requested by |
180 // GetBitmapNamed(). | 196 // GetBitmapNamed(). |
181 mutable ImageCache gtk_images_; | 197 mutable ImageCache gtk_images_; |
182 | 198 |
183 // Cairo surfaces for each GdkDisplay. | 199 // Cairo surfaces for each GdkDisplay. |
184 typedef std::map<int, CairoCachedSurface*> CairoCachedSurfaceMap; | 200 typedef std::map<int, CairoCachedSurface*> CairoCachedSurfaceMap; |
185 typedef std::map<GdkDisplay*, CairoCachedSurfaceMap> PerDisplaySurfaceMap; | 201 typedef std::map<GdkDisplay*, CairoCachedSurfaceMap> PerDisplaySurfaceMap; |
186 PerDisplaySurfaceMap per_display_surfaces_; | 202 PerDisplaySurfaceMap per_display_surfaces_; |
187 | 203 |
188 // This is a dummy widget that only exists so we have something to pass to | 204 // This is a dummy widget that only exists so we have something to pass to |
189 // gtk_widget_render_icon(). | 205 // gtk_widget_render_icon(). |
190 static GtkWidget* icon_widget_; | 206 static GtkWidget* icon_widget_; |
191 | 207 |
192 // The default folder icon and default bookmark icon for the GTK theme. | 208 // The default folder icon and default bookmark icon for the GTK theme. |
193 // These are static because the system can only have one theme at a time. | 209 // These are static because the system can only have one theme at a time. |
194 // They are cached when they are requested the first time, and cleared when | 210 // They are cached when they are requested the first time, and cleared when |
195 // the system theme changes. | 211 // the system theme changes. |
196 static GdkPixbuf* default_folder_icon_; | 212 static GdkPixbuf* default_folder_icon_; |
197 static GdkPixbuf* default_bookmark_icon_; | 213 static GdkPixbuf* default_bookmark_icon_; |
198 }; | 214 }; |
199 | 215 |
200 #endif // CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ | 216 #endif // CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ |
OLD | NEW |