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

Unified Diff: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc

Issue 8511041: GTK: Use IDR_THEME_WINDOW_CONTROL_BACKGROUND when drawing min/max/close and new tab buttons. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: estade nits Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
« no previous file with comments | « chrome/browser/ui/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698