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 "chrome/browser/browser_theme_provider.h" | 8 #include "chrome/browser/browser_theme_provider.h" |
9 | 9 |
10 #include "skia/ext/skia_utils.h" | 10 #include "skia/ext/skia_utils.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Sets the underlying theme colors/tints from a GTK color. | 51 // Sets the underlying theme colors/tints from a GTK color. |
52 void SetThemeColorFromGtk(const char* id, GdkColor* color); | 52 void SetThemeColorFromGtk(const char* id, GdkColor* color); |
53 void SetThemeTintFromGtk(const char* id, GdkColor* color, | 53 void SetThemeTintFromGtk(const char* id, GdkColor* color, |
54 const skia::HSL& default_tint); | 54 const skia::HSL& default_tint); |
55 | 55 |
56 // A GtkWidget that exists only so we can look at its properties (and take | 56 // A GtkWidget that exists only so we can look at its properties (and take |
57 // its colors). | 57 // its colors). |
58 GtkWidget* fake_window_; | 58 GtkWidget* fake_window_; |
59 }; | 59 }; |
60 | 60 |
| 61 // A Helper struct used throughout the GTK themeing code. It retrieves settings |
| 62 // from the Profile once at creation time, instead of at every access time. A |
| 63 // large motivation for making this struct is so that we only have to pass one |
| 64 // parameter around when configuring things due to a theme event. This way, we |
| 65 // can use a lot of GTK convenience features likt gtk_container_foreach(). |
| 66 struct GtkThemeProperties { |
| 67 GtkThemeProperties(Profile* profile); |
| 68 |
| 69 // A wrapper around ThemeProvider::GetColor, transforming the result to a |
| 70 // GdkColor. |
| 71 GdkColor GetGdkColor(int id); |
| 72 |
| 73 bool use_gtk_rendering; |
| 74 ThemeProvider* provider; |
| 75 }; |
| 76 |
61 #endif // CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ | 77 #endif // CHROME_BROWSER_GTK_GTK_THEME_PROVIDER_H_ |
OLD | NEW |