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

Side by Side Diff: chrome/browser/gtk/gtk_theme_provider.h

Issue 150176: GTK: First draft of using native themes, partially based on evan's CL 118358. (Closed)
Patch Set: And the codereview tool is back. Created 11 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_
6 #define CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_
7
8 #include "chrome/browser/browser_theme_provider.h"
9
10 #include "skia/ext/skia_utils.h"
11
12 class Profile;
13
14 typedef struct _GtkStyle GtkStyle;
15 typedef struct _GtkWidget GtkWidget;
16
17 // Specialization of BrowserThemeProvider which supplies system colors.
18 class GtkThemeProvider : public BrowserThemeProvider {
19 public:
20 GtkThemeProvider();
21 virtual ~GtkThemeProvider();
22
23 // Overridden from BrowserThemeProvider:
24 //
25 // Sets that we aren't using the system theme, then calls
26 // BrowserThemeProvider's implementation.
27 virtual void SetTheme(Extension* extension);
28 virtual void UseDefaultTheme();
29 virtual void SetNativeTheme();
30
31 // Whether we should use the GTK system theme.
32 static bool UseSystemThemeGraphics(Profile* profile);
33
34 private:
35 // Load theme data from preferences, possibly picking colors from GTK.
36 virtual void LoadThemePrefs();
37
38 // Possibly creates a theme specific version of theme_toolbar_default.
39 // (minimally acceptable version right now, which is just a fill of the bg
40 // color; this should instead invoke gtk_draw_box(...) for complex theme
41 // engines.)
42 virtual SkBitmap* LoadThemeBitmap(int id);
43
44 // Handles signal from GTK that our theme has been changed.
45 static void OnStyleSet(GtkWidget* widget,
46 GtkStyle* previous_style,
47 GtkThemeProvider* provider);
48
49 void LoadGtkValues();
50
51 // Sets the underlying theme colors/tints from a GTK color.
52 void SetThemeColorFromGtk(const char* id, GdkColor* color);
53 void SetThemeTintFromGtk(const char* id, GdkColor* color,
54 const skia::HSL& default_tint);
55
56 // A GtkWidget that exists only so we can look at its properties (and take
57 // its colors).
58 GtkWidget* fake_window_;
59 };
60
61 #endif // CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698