summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 23:23:08 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-13 23:23:08 +0000
commit5fdafb2f68bd61ef92d10194402348d1e5839015 (patch)
treefb8583216c733e2a2218501646cf8c72fec35bb1 /chrome/browser/gtk/toolbar_star_toggle_gtk.cc
parent0735266658f996210b6f43142ce7f4c55f47ae13 (diff)
downloadchromium_src-5fdafb2f68bd61ef92d10194402348d1e5839015.zip
chromium_src-5fdafb2f68bd61ef92d10194402348d1e5839015.tar.gz
chromium_src-5fdafb2f68bd61ef92d10194402348d1e5839015.tar.bz2
GTK Themes: Refactored to use notifications instead of manual plumbing.
- Removes large amounts of plumbing because: - All GtkChromeButtons are constructed from GtkThemeProvider which keeps a reference to all live buttons and sends them theme change notifications. - CustomDrawButtons now subscribe themselves to the BROWSER_THEME_CHANGED notification; this gets rid of a LOT of plubming. - Removes the GtkThemeProperties struct; just pass the theme provider around. - Move all the constants from the themes namespace to class statics, per tony's suggestion Review URL: http://codereview.chromium.org/149547 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/toolbar_star_toggle_gtk.cc')
-rw-r--r--chrome/browser/gtk/toolbar_star_toggle_gtk.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
index 2692df7..0fd1045 100644
--- a/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
+++ b/chrome/browser/gtk/toolbar_star_toggle_gtk.cc
@@ -8,6 +8,7 @@
#include "base/gfx/rect.h"
#include "chrome/browser/gtk/bookmark_bubble_gtk.h"
#include "chrome/browser/gtk/browser_toolbar_gtk.h"
+#include "chrome/browser/gtk/gtk_theme_provider.h"
#include "chrome/browser/profile.h"
#include "grit/theme_resources.h"
@@ -15,10 +16,10 @@ ToolbarStarToggleGtk::ToolbarStarToggleGtk(BrowserToolbarGtk* host)
: host_(host),
widget_(gtk_button_new()),
is_starred_(false),
- unstarred_(host->profile()->GetThemeProvider(), IDR_STAR, IDR_STAR_P,
- IDR_STAR_H, IDR_STAR_D),
- starred_(host->profile()->GetThemeProvider(), IDR_STARRED, IDR_STARRED_P,
- IDR_STARRED_H, 0) {
+ unstarred_(GtkThemeProvider::GetFrom(host->profile()),
+ IDR_STAR, IDR_STAR_P, IDR_STAR_H, IDR_STAR_D),
+ starred_(GtkThemeProvider::GetFrom(host->profile()),
+ IDR_STARRED, IDR_STARRED_P, IDR_STARRED_H, 0) {
gtk_widget_set_size_request(widget_.get(),
gdk_pixbuf_get_width(unstarred_.pixbufs(0)),
gdk_pixbuf_get_height(unstarred_.pixbufs(0)));