| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 g_object_unref(context); | 170 g_object_unref(context); |
| 171 return; | 171 return; |
| 172 } | 172 } |
| 173 context = parent; | 173 context = parent; |
| 174 } | 174 } |
| 175 } | 175 } |
| 176 | 176 |
| 177 typedef ScopedGObject<GtkStyleContext> ScopedStyleContext; | 177 typedef ScopedGObject<GtkStyleContext> ScopedStyleContext; |
| 178 typedef ScopedGObject<GtkCssProvider> ScopedCssProvider; | 178 typedef ScopedGObject<GtkCssProvider> ScopedCssProvider; |
| 179 | 179 |
| 180 // Converts ui::NativeTheme::State to GtkStateFlags. |
| 181 GtkStateFlags StateToStateFlags(ui::NativeTheme::State state); |
| 182 |
| 180 // If |context| is nullptr, creates a new top-level style context | 183 // If |context| is nullptr, creates a new top-level style context |
| 181 // specified by parsing |css_node|. Otherwise, creates the child | 184 // specified by parsing |css_node|. Otherwise, creates the child |
| 182 // context with |context| as the parent. | 185 // context with |context| as the parent. |
| 183 ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context, | 186 ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context, |
| 184 const std::string& css_node); | 187 const std::string& css_node); |
| 185 | 188 |
| 186 // Parses |css_selector| into a GtkStyleContext. The format is a | 189 // Parses |css_selector| into a GtkStyleContext. The format is a |
| 187 // sequence of whitespace-separated objects. Each object may have at | 190 // sequence of whitespace-separated objects. Each object may have at |
| 188 // most one object name at the beginning of the string, and any number | 191 // most one object name at the beginning of the string, and any number |
| 189 // of '.'-prefixed classes and ':'-prefixed pseudoclasses. An example | 192 // of '.'-prefixed classes and ':'-prefixed pseudoclasses. An example |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // the background-color property. | 224 // the background-color property. |
| 222 SkColor GetSelectionBgColor(const char* css_selector); | 225 SkColor GetSelectionBgColor(const char* css_selector); |
| 223 | 226 |
| 224 // Get the color of the GtkSeparator specified by |css_selector|. | 227 // Get the color of the GtkSeparator specified by |css_selector|. |
| 225 SkColor GetSeparatorColor(const char* css_selector); | 228 SkColor GetSeparatorColor(const char* css_selector); |
| 226 #endif | 229 #endif |
| 227 | 230 |
| 228 } // namespace libgtkui | 231 } // namespace libgtkui |
| 229 | 232 |
| 230 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ | 233 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UTIL_H_ |
| OLD | NEW |