Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: chrome/browser/ui/gtk/custom_button.cc

Issue 7809007: GTK: Clean up the gtk extension infobar implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/gtk/custom_button.cc
diff --git a/chrome/browser/ui/gtk/custom_button.cc b/chrome/browser/ui/gtk/custom_button.cc
index fe2b52a28df5a7ffa2f1237a4ff57c7a93ade5f7..26fe1b410e094424167cb276a892da98280f2e4d 100644
--- a/chrome/browser/ui/gtk/custom_button.cc
+++ b/chrome/browser/ui/gtk/custom_button.cc
@@ -238,7 +238,8 @@ CustomDrawButton::CustomDrawButton(GtkThemeService* theme_provider,
GtkIconSize stock_size)
: button_base_(theme_provider, normal_id, pressed_id, hover_id,
disabled_id),
- theme_service_(theme_provider) {
+ theme_service_(theme_provider),
+ forcing_chrome_theme_(false) {
native_widget_.Own(gtk_image_new_from_stock(stock_id, stock_size));
Init();
@@ -258,7 +259,8 @@ CustomDrawButton::CustomDrawButton(GtkThemeService* theme_provider,
: button_base_(theme_provider, normal_id, pressed_id, hover_id,
disabled_id),
native_widget_(native_widget),
- theme_service_(theme_provider) {
+ theme_service_(theme_provider),
+ forcing_chrome_theme_(false) {
Init();
theme_service_->InitThemesFor(this);
@@ -280,6 +282,11 @@ void CustomDrawButton::Init() {
hover_controller_.Init(widget());
}
+void CustomDrawButton::ForceChromeTheme() {
+ forcing_chrome_theme_ = true;
+ SetBrowserTheme();
+}
+
void CustomDrawButton::Observe(int type,
const NotificationSource& source, const NotificationDetails& details) {
DCHECK(chrome::NOTIFICATION_BROWSER_THEME_CHANGED == type);
@@ -350,5 +357,6 @@ void CustomDrawButton::SetBrowserTheme() {
}
bool CustomDrawButton::UseGtkTheme() {
- return theme_service_ && theme_service_->UsingNativeTheme();
+ return !forcing_chrome_theme_ && theme_service_ &&
+ theme_service_->UsingNativeTheme();
}

Powered by Google App Engine
This is Rietveld 408576698