| 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_GTK_CUSTOM_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 // Set the background details. | 190 // Set the background details. |
| 191 void SetBackground(SkColor color, | 191 void SetBackground(SkColor color, |
| 192 const SkBitmap& image, | 192 const SkBitmap& image, |
| 193 const SkBitmap& mask); | 193 const SkBitmap& mask); |
| 194 | 194 |
| 195 // content::NotificationObserver implementation. | 195 // content::NotificationObserver implementation. |
| 196 virtual void Observe(int type, | 196 virtual void Observe(int type, |
| 197 const content::NotificationSource& source, | 197 const content::NotificationSource& source, |
| 198 const content::NotificationDetails& details) OVERRIDE; | 198 const content::NotificationDetails& details) OVERRIDE; |
| 199 | 199 |
| 200 // Returns a standard close button. Pass a |theme_provider| to use Gtk icons | 200 // Returns a standard close button used for infobars and shelves (smaller |
| 201 // in Gtk rendering mode. | 201 // with red hover). |
| 202 static CustomDrawButton* CloseButton(GtkThemeService* theme_provider); | 202 // Pass a |theme_provider| to use Gtk icons in Gtk rendering mode. |
| 203 static CustomDrawButton* CloseButtonBar(GtkThemeService* theme_provider); |
| 204 |
| 205 // Returns a standard close button used for bubbles (larger). |
| 206 // Pass a |theme_provider| to use Gtk icons in Gtk rendering mode. |
| 207 static CustomDrawButton* CloseButtonBubble(GtkThemeService* theme_provider); |
| 203 | 208 |
| 204 private: | 209 private: |
| 205 // Sets the button to themed or not. | 210 // Sets the button to themed or not. |
| 206 void SetBrowserTheme(); | 211 void SetBrowserTheme(); |
| 207 | 212 |
| 208 // Whether to use the GTK+ theme. For this to be true, we have to be in GTK+ | 213 // Whether to use the GTK+ theme. For this to be true, we have to be in GTK+ |
| 209 // theme mode and we must have a valid stock icon resource. | 214 // theme mode and we must have a valid stock icon resource. |
| 210 bool UseGtkTheme(); | 215 bool UseGtkTheme(); |
| 211 | 216 |
| 212 // Callback for custom button expose, used to draw the custom graphics. | 217 // Callback for custom button expose, used to draw the custom graphics. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 229 // True if we should never do gtk rendering. | 234 // True if we should never do gtk rendering. |
| 230 bool forcing_chrome_theme_; | 235 bool forcing_chrome_theme_; |
| 231 | 236 |
| 232 // Used to listen for theme change notifications. | 237 // Used to listen for theme change notifications. |
| 233 content::NotificationRegistrar registrar_; | 238 content::NotificationRegistrar registrar_; |
| 234 | 239 |
| 235 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); | 240 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); |
| 236 }; | 241 }; |
| 237 | 242 |
| 238 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 243 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
| OLD | NEW |