OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_GTK_GTK_THEME_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
6 #define CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ | 6 #define CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // This method returns the colors webkit will use for the scrollbars. When no | 109 // This method returns the colors webkit will use for the scrollbars. When no |
110 // colors are specified by the GTK+ theme, this function averages of the | 110 // colors are specified by the GTK+ theme, this function averages of the |
111 // thumb part and of the track colors. | 111 // thumb part and of the track colors. |
112 void GetScrollbarColors(GdkColor* thumb_active_color, | 112 void GetScrollbarColors(GdkColor* thumb_active_color, |
113 GdkColor* thumb_inactive_color, | 113 GdkColor* thumb_inactive_color, |
114 GdkColor* track_color); | 114 GdkColor* track_color); |
115 | 115 |
116 // Expose the inner label. Only used for testing. | 116 // Expose the inner label. Only used for testing. |
117 GtkWidget* fake_label() { return fake_label_.get(); } | 117 GtkWidget* fake_label() { return fake_label_.get(); } |
118 | 118 |
119 // Returns a CairoCachedSurface for a particular Display. CairoCachedSurfaces | |
120 // (hopefully) live on the X server, instead of the client so we don't have | |
121 // to send the image to the server on each expose. | |
122 gfx::CairoCachedSurface* GetSurfaceNamed( | |
123 int id, GtkWidget* widget_on_display); | |
124 | |
125 // Same as above, but auto-mirrors the underlying pixbuf in RTL mode. | 119 // Same as above, but auto-mirrors the underlying pixbuf in RTL mode. |
126 gfx::CairoCachedSurface* GetRTLEnabledSurfaceNamed( | 120 gfx::CairoCachedSurface* GetRTLEnabledSurfaceNamed( |
127 int id, GtkWidget* widget_on_display); | 121 int id, GtkWidget* widget_on_display); |
128 | 122 |
129 // Same as above, but gets the resource from the ResourceBundle instead of the | |
130 // ThemeService. | |
131 // NOTE: Never call this with resource IDs that are ever passed to the above | |
132 // two functions! Depending on which call comes first, all callers will | |
133 // either get the themed or the unthemed version. | |
134 gfx::CairoCachedSurface* GetUnthemedSurfaceNamed( | |
135 int id, GtkWidget* widget_on_display); | |
136 | |
137 // A way to get a cached cairo surface for the equivalent of GetFolderIcon() | 123 // A way to get a cached cairo surface for the equivalent of GetFolderIcon() |
138 // or GetDefaultFavicon(). Uses the ids defined in CairoDefaultIcon. | 124 // or GetDefaultFavicon(). Uses the ids defined in CairoDefaultIcon. |
139 gfx::CairoCachedSurface* GetCairoIcon(int id, GtkWidget* widget_on_display); | 125 gfx::CairoCachedSurface* GetCairoIcon(int id, GtkWidget* widget_on_display); |
140 | 126 |
141 // Returns colors that we pass to webkit to match the system theme. | 127 // Returns colors that we pass to webkit to match the system theme. |
142 const SkColor& get_focus_ring_color() const { return focus_ring_color_; } | 128 const SkColor& get_focus_ring_color() const { return focus_ring_color_; } |
143 const SkColor& get_thumb_active_color() const { return thumb_active_color_; } | 129 const SkColor& get_thumb_active_color() const { return thumb_active_color_; } |
144 const SkColor& get_thumb_inactive_color() const { | 130 const SkColor& get_thumb_inactive_color() const { |
145 return thumb_inactive_color_; | 131 return thumb_inactive_color_; |
146 } | 132 } |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 333 |
348 // The default folder icon and default bookmark icon for the GTK theme. | 334 // The default folder icon and default bookmark icon for the GTK theme. |
349 // These are static because the system can only have one theme at a time. | 335 // These are static because the system can only have one theme at a time. |
350 // They are cached when they are requested the first time, and cleared when | 336 // They are cached when they are requested the first time, and cleared when |
351 // the system theme changes. | 337 // the system theme changes. |
352 static GdkPixbuf* default_folder_icon_; | 338 static GdkPixbuf* default_folder_icon_; |
353 static GdkPixbuf* default_bookmark_icon_; | 339 static GdkPixbuf* default_bookmark_icon_; |
354 }; | 340 }; |
355 | 341 |
356 #endif // CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ | 342 #endif // CHROME_BROWSER_UI_GTK_GTK_THEME_SERVICE_H_ |
OLD | NEW |