Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 151 int normal_id, | 151 int normal_id, |
| 152 int pressed_id, | 152 int pressed_id, |
| 153 int hover_id, | 153 int hover_id, |
| 154 int disabled_id, | 154 int disabled_id, |
| 155 GtkWidget* native_widget); | 155 GtkWidget* native_widget); |
| 156 | 156 |
| 157 virtual ~CustomDrawButton(); | 157 virtual ~CustomDrawButton(); |
| 158 | 158 |
| 159 void Init(); | 159 void Init(); |
| 160 | 160 |
| 161 void ForceBrowserTheme(); | |
|
Finnur
2011/08/31 08:06:59
nit: comment.
| |
| 162 | |
| 161 // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL | 163 // Flip the image horizontally. Not to be used for RTL/LTR reasons. (In RTL |
| 162 // mode, this will unflip the image.) | 164 // mode, this will unflip the image.) |
| 163 void set_flipped(bool flipped) { button_base_.set_flipped(flipped); } | 165 void set_flipped(bool flipped) { button_base_.set_flipped(flipped); } |
| 164 | 166 |
| 165 GtkWidget* widget() const { return widget_.get(); } | 167 GtkWidget* widget() const { return widget_.get(); } |
| 166 | 168 |
| 167 gfx::Rect bounds() const { | 169 gfx::Rect bounds() const { |
| 168 return gfx::Rect(widget_->allocation.x, | 170 return gfx::Rect(widget_->allocation.x, |
| 169 widget_->allocation.y, | 171 widget_->allocation.y, |
| 170 widget_->allocation.width, | 172 widget_->allocation.width, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 215 CustomDrawButtonBase button_base_; | 217 CustomDrawButtonBase button_base_; |
| 216 | 218 |
| 217 CustomDrawHoverController hover_controller_; | 219 CustomDrawHoverController hover_controller_; |
| 218 | 220 |
| 219 // The widget to use when we are displaying in GTK+ theme mode. | 221 // The widget to use when we are displaying in GTK+ theme mode. |
| 220 ui::OwnedWidgetGtk native_widget_; | 222 ui::OwnedWidgetGtk native_widget_; |
| 221 | 223 |
| 222 // Our theme provider. | 224 // Our theme provider. |
| 223 GtkThemeService* theme_service_; | 225 GtkThemeService* theme_service_; |
| 224 | 226 |
| 227 // Some buttons are always drawn in chrome style because they are part of | |
| 228 // HTML extensions. | |
| 229 bool forcing_browser_theme_; | |
| 230 | |
| 225 // Used to listen for theme change notifications. | 231 // Used to listen for theme change notifications. |
| 226 NotificationRegistrar registrar_; | 232 NotificationRegistrar registrar_; |
| 227 | 233 |
| 228 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); | 234 DISALLOW_COPY_AND_ASSIGN(CustomDrawButton); |
| 229 }; | 235 }; |
| 230 | 236 |
| 231 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ | 237 #endif // CHROME_BROWSER_UI_GTK_CUSTOM_BUTTON_H_ |
| OLD | NEW |