OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LIBGTKUI_GTK_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ |
6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Parses |css_selector| into a GtkStyleContext. The format is a | 159 // Parses |css_selector| into a GtkStyleContext. The format is a |
160 // sequence of whitespace-separated objects. Each object may have at | 160 // sequence of whitespace-separated objects. Each object may have at |
161 // most one object name at the beginning of the string, and any number | 161 // most one object name at the beginning of the string, and any number |
162 // of '.'-prefixed classes and ':'-prefixed pseudoclasses. An example | 162 // of '.'-prefixed classes and ':'-prefixed pseudoclasses. An example |
163 // is "GtkButton.button.suggested-action:hover:active". The caller | 163 // is "GtkButton.button.suggested-action:hover:active". The caller |
164 // must g_object_unref() the returned context. | 164 // must g_object_unref() the returned context. |
165 ScopedStyleContext GetStyleContextFromCss(const std::string& css_selector); | 165 ScopedStyleContext GetStyleContextFromCss(const std::string& css_selector); |
166 | 166 |
167 SkColor GetFgColorFromStyleContext(GtkStyleContext* context); | 167 SkColor GetFgColorFromStyleContext(GtkStyleContext* context); |
168 | 168 |
| 169 SkColor GetBgColorFromStyleContext(GtkStyleContext* context); |
| 170 |
169 // Overrides properties on |context| and all its parents with those | 171 // Overrides properties on |context| and all its parents with those |
170 // provided by |css|. | 172 // provided by |css|. |
171 void ApplyCssToContext(GtkStyleContext* context, const std::string& css); | 173 void ApplyCssToContext(GtkStyleContext* context, const std::string& css); |
172 | 174 |
173 // Get the 'color' property from the style context created by | 175 // Get the 'color' property from the style context created by |
174 // GetStyleContextFromCss(|css_selector|). | 176 // GetStyleContextFromCss(|css_selector|). |
175 SkColor GetFgColor(const std::string& css_selector); | 177 SkColor GetFgColor(const std::string& css_selector); |
176 | 178 |
177 ScopedCssProvider GetCssProvider(const std::string& css); | 179 ScopedCssProvider GetCssProvider(const std::string& css); |
178 | 180 |
(...skipping 17 matching lines...) Expand all Loading... |
196 // the background-color property. | 198 // the background-color property. |
197 SkColor GetSelectionBgColor(const std::string& css_selector); | 199 SkColor GetSelectionBgColor(const std::string& css_selector); |
198 | 200 |
199 // Get the color of the GtkSeparator specified by |css_selector|. | 201 // Get the color of the GtkSeparator specified by |css_selector|. |
200 SkColor GetSeparatorColor(const std::string& css_selector); | 202 SkColor GetSeparatorColor(const std::string& css_selector); |
201 #endif | 203 #endif |
202 | 204 |
203 } // namespace libgtkui | 205 } // namespace libgtkui |
204 | 206 |
205 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ | 207 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ |
OLD | NEW |