| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ |
| 6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ | 6 #define CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 // ThemeService interface and the colors we send to webkit. | 119 // ThemeService interface and the colors we send to webkit. |
| 120 void LoadGtkValues(); | 120 void LoadGtkValues(); |
| 121 | 121 |
| 122 // Initialize the Xcursor theme and size with the GTK theme and size. | 122 // Initialize the Xcursor theme and size with the GTK theme and size. |
| 123 void LoadCursorTheme(); | 123 void LoadCursorTheme(); |
| 124 | 124 |
| 125 // Reads in explicit theme frame colors from the ChromeGtkFrame style class | 125 // Reads in explicit theme frame colors from the ChromeGtkFrame style class |
| 126 // or generates them per our fallback algorithm. | 126 // or generates them per our fallback algorithm. |
| 127 void BuildFrameColors(); | 127 void BuildFrameColors(); |
| 128 | 128 |
| 129 // Gets a tint which depends on the default for |id| as well as |color|. | |
| 130 color_utils::HSL ColorToTint(int id, SkColor color); | |
| 131 | |
| 132 // Returns the tint for buttons that contrasts with the normal window | |
| 133 // background color. | |
| 134 void GetNormalButtonTintHSL(color_utils::HSL* tint) const; | |
| 135 | |
| 136 // Returns a tint that's the color of the current normal text in an entry. | |
| 137 void GetNormalEntryForegroundHSL(color_utils::HSL* tint) const; | |
| 138 | |
| 139 // Returns a tint that's the color of the current highlighted text in an | |
| 140 // entry. | |
| 141 void GetSelectedEntryForegroundHSL(color_utils::HSL* tint) const; | |
| 142 | |
| 143 // Gets a color for the background of the prominent button. | |
| 144 SkColor GetProminentButtonBgColor(int gtk_state) const; | |
| 145 | |
| 146 // Updates |default_font_*|. | 129 // Updates |default_font_*|. |
| 147 void UpdateDefaultFont(); | 130 void UpdateDefaultFont(); |
| 148 | 131 |
| 149 // Gets a ChromeGtkFrame theme color; returns true on success. No-op on gtk3. | 132 // Gets a ChromeGtkFrame theme color; returns true on success. No-op on gtk3. |
| 150 bool GetChromeStyleColor(const char* sytle_property, | 133 bool GetChromeStyleColor(const char* sytle_property, |
| 151 SkColor* ret_color) const; | 134 SkColor* ret_color) const; |
| 152 | 135 |
| 153 ui::NativeTheme* native_theme_; | 136 ui::NativeTheme* native_theme_; |
| 154 | 137 |
| 155 // A GtkWindow object with the class "ChromeGtkFrame". | 138 // A GtkWindow object with the class "ChromeGtkFrame". |
| 156 GtkWidget* fake_window_; | 139 GtkWidget* fake_window_; |
| 157 | 140 |
| 158 // Colors calculated by LoadGtkValues() that are given to the | 141 // Colors calculated by LoadGtkValues() that are given to the |
| 159 // caller while |use_gtk_| is true. | 142 // caller while |use_gtk_| is true. |
| 160 ColorMap colors_; | 143 ColorMap colors_; |
| 161 | 144 |
| 162 // Colors used to tint certain icons. | |
| 163 color_utils::HSL button_tint_; | |
| 164 color_utils::HSL entry_tint_; | |
| 165 color_utils::HSL selected_entry_tint_; | |
| 166 | |
| 167 // Colors that we pass to WebKit. These are generated each time the theme | 145 // Colors that we pass to WebKit. These are generated each time the theme |
| 168 // changes. | 146 // changes. |
| 169 SkColor focus_ring_color_; | 147 SkColor focus_ring_color_; |
| 170 SkColor thumb_active_color_; | 148 SkColor thumb_active_color_; |
| 171 SkColor thumb_inactive_color_; | 149 SkColor thumb_inactive_color_; |
| 172 SkColor track_color_; | 150 SkColor track_color_; |
| 173 SkColor active_selection_bg_color_; | 151 SkColor active_selection_bg_color_; |
| 174 SkColor active_selection_fg_color_; | 152 SkColor active_selection_fg_color_; |
| 175 SkColor inactive_selection_bg_color_; | 153 SkColor inactive_selection_bg_color_; |
| 176 SkColor inactive_selection_fg_color_; | 154 SkColor inactive_selection_fg_color_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 } // namespace libgtkui | 194 } // namespace libgtkui |
| 217 | 195 |
| 218 // Access point to the GTK2 desktop system. This should be the only symbol that | 196 // Access point to the GTK2 desktop system. This should be the only symbol that |
| 219 // is exported in the library; everything else should be used through the | 197 // is exported in the library; everything else should be used through the |
| 220 // interface, because eventually this .so will be loaded through dlopen at | 198 // interface, because eventually this .so will be loaded through dlopen at |
| 221 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or | 199 // runtime so our main binary can conditionally load GTK2 or GTK3 or EFL or |
| 222 // QT or whatever. | 200 // QT or whatever. |
| 223 LIBGTKUI_EXPORT views::LinuxUI* BuildGtkUi(); | 201 LIBGTKUI_EXPORT views::LinuxUI* BuildGtkUi(); |
| 224 | 202 |
| 225 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ | 203 #endif // CHROME_BROWSER_UI_LIBGTKUI_GTK_UI_H_ |
| OLD | NEW |