diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 23:23:08 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-13 23:23:08 +0000 |
commit | 5fdafb2f68bd61ef92d10194402348d1e5839015 (patch) | |
tree | fb8583216c733e2a2218501646cf8c72fec35bb1 /chrome/browser/gtk/download_shelf_gtk.h | |
parent | 0735266658f996210b6f43142ce7f4c55f47ae13 (diff) | |
download | chromium_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/download_shelf_gtk.h')
-rw-r--r-- | chrome/browser/gtk/download_shelf_gtk.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/chrome/browser/gtk/download_shelf_gtk.h b/chrome/browser/gtk/download_shelf_gtk.h index 9c8e382..ae7923b 100644 --- a/chrome/browser/gtk/download_shelf_gtk.h +++ b/chrome/browser/gtk/download_shelf_gtk.h @@ -12,16 +12,19 @@ #include "base/gfx/native_widget_types.h" #include "base/scoped_ptr.h" #include "chrome/browser/download/download_shelf.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" #include "chrome/common/owned_widget_gtk.h" class BaseDownloadItemModel; class Browser; class CustomDrawButton; class DownloadItemGtk; -class GtkThemeProperties; +class GtkThemeProvider; class SlideAnimatorGtk; -class DownloadShelfGtk : public DownloadShelf { +class DownloadShelfGtk : public DownloadShelf, + public NotificationObserver { public: explicit DownloadShelfGtk(Browser* browser, gfx::NativeView view); @@ -34,12 +37,14 @@ class DownloadShelfGtk : public DownloadShelf { virtual void Show(); virtual void Close(); + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); + // Returns the current height of the shelf. int GetHeight() const; - // Changes the color of the background shelf. - void UserChangedTheme(GtkThemeProperties* properties); - private: // Remove |download_item| from the download shelf and delete it. void RemoveDownloadItem(DownloadItemGtk* download_item); @@ -78,6 +83,11 @@ class DownloadShelfGtk : public DownloadShelf { // The download items we have added to our shelf. std::vector<DownloadItemGtk*> download_items_; + // Gives us our colors and theme information. + GtkThemeProvider* theme_provider_; + + NotificationRegistrar registrar_; + friend class DownloadItemGtk; }; |