Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc |
diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc |
index 27acd3df27dbfacbc139890eb4e7138845eaa844..9692b73e517065a1b9720d1d3d5a6b6c6b2db8c4 100644 |
--- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc |
+++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc |
@@ -25,6 +25,7 @@ |
#include "chrome/browser/ui/gtk/tabs/dragged_tab_controller_gtk.h" |
#include "chrome/browser/ui/gtk/tabs/tab_strip_menu_controller.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
+#include "chrome/common/chrome_notification_types.h" |
#include "content/browser/tab_contents/tab_contents.h" |
#include "content/public/browser/notification_source.h" |
#include "grit/theme_resources.h" |
@@ -778,6 +779,10 @@ void TabStripGtk::Init() { |
drop_indicator_height = gdk_pixbuf_get_height(drop_image); |
} |
+ registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
+ content::Source<ThemeService>(theme_service_)); |
+ theme_service_->InitThemesFor(this); |
+ |
ViewIDUtil::SetDelegateForWidget(widget(), this); |
} |
@@ -1302,6 +1307,16 @@ void TabStripGtk::DidProcessEvent(GdkEvent* event) { |
} |
} |
+/////////////////////////////////////////////////////////////////////////////// |
+// TabStripGtk, content::NotificationObserver implementation: |
+ |
+void TabStripGtk::Observe(int type, |
+ const content::NotificationSource& source, |
+ const content::NotificationDetails& details) { |
+ DCHECK_EQ(type, chrome::NOTIFICATION_BROWSER_THEME_CHANGED); |
+ SetNewTabButtonBackground(); |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// TabStripGtk, private: |
@@ -2201,3 +2216,12 @@ CustomDrawButton* TabStripGtk::MakeNewTabButton() { |
return button; |
} |
+ |
+void TabStripGtk::SetNewTabButtonBackground() { |
+ SkColor color = theme_service_->GetColor( |
+ ThemeService::COLOR_BUTTON_BACKGROUND); |
+ SkBitmap* background = theme_service_->GetBitmapNamed( |
+ IDR_THEME_WINDOW_CONTROL_BACKGROUND); |
+ SkBitmap* mask = theme_service_->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK); |
+ newtab_button_->SetBackground(color, background, mask); |
+} |