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_item_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_item_gtk.h')
-rw-r--r-- | chrome/browser/gtk/download_item_gtk.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/chrome/browser/gtk/download_item_gtk.h b/chrome/browser/gtk/download_item_gtk.h index bae5cbd..9fd94c9 100644 --- a/chrome/browser/gtk/download_item_gtk.h +++ b/chrome/browser/gtk/download_item_gtk.h @@ -7,22 +7,27 @@ #include <gtk/gtk.h> +#include <string> + #include "app/animation.h" #include "base/scoped_ptr.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/icon_manager.h" +#include "chrome/common/notification_observer.h" +#include "chrome/common/notification_registrar.h" #include "chrome/common/owned_widget_gtk.h" class BaseDownloadItemModel; class DownloadShelfContextMenuGtk; class DownloadShelfGtk; -class GtkThemeProperties; +class GtkThemeProvider; class NineBox; class SkBitmap; class SlideAnimation; class DownloadItemGtk : public DownloadItem::Observer, - public AnimationDelegate { + public AnimationDelegate, + public NotificationObserver { public: // DownloadItemGtk takes ownership of |download_item_model|. DownloadItemGtk(DownloadShelfGtk* parent_shelf, @@ -38,8 +43,10 @@ class DownloadItemGtk : public DownloadItem::Observer, // AnimationDelegate implementation. virtual void AnimationProgressed(const Animation* animation); - // Changes the color of the background shelf. - void UserChangedTheme(GtkThemeProperties* properties); + // Overridden from NotificationObserver: + virtual void Observe(NotificationType type, + const NotificationSource& source, + const NotificationDetails& details); // Called when the icon manager has finished loading the icon. We take // ownership of |icon_bitmap|. @@ -143,7 +150,7 @@ class DownloadItemGtk : public DownloadItem::Observer, bool menu_showing_; // Whether we should use the GTK text color - bool use_gtk_colors_; + GtkThemeProvider* theme_provider_; // The widget that contains the animation progress and the file's icon // (as well as the complete animation). @@ -183,6 +190,8 @@ class DownloadItemGtk : public DownloadItem::Observer, // The file icon for the download. May be null. SkBitmap* icon_; + NotificationRegistrar registrar_; + // For canceling an in progress icon request. CancelableRequestConsumerT<int, 0> icon_consumer_; }; |