summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs/tab_renderer_gtk.h
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 23:36:05 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-15 23:36:05 +0000
commit1caa3c45a35a72ba3cae29c277d34b44de8b1138 (patch)
treed581f1aaeecb0451748c702e6d22ecdfad4ca03d /chrome/browser/gtk/tabs/tab_renderer_gtk.h
parent4cab04d8c4c0c45ce63e03b5f255da4a92d70ff0 (diff)
downloadchromium_src-1caa3c45a35a72ba3cae29c277d34b44de8b1138.zip
chromium_src-1caa3c45a35a72ba3cae29c277d34b44de8b1138.tar.gz
chromium_src-1caa3c45a35a72ba3cae29c277d34b44de8b1138.tar.bz2
GTK Themes: Tint throbbers like we tint all other buttons in the interface.
Relanding with fixes for unit tests. Run through trybot this time... http://crbug.com/13967 Original Review URL: http://codereview.chromium.org/155588 TBR=estade Review URL: http://codereview.chromium.org/155601 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20809 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs/tab_renderer_gtk.h')
-rw-r--r--chrome/browser/gtk/tabs/tab_renderer_gtk.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/gtk/tabs/tab_renderer_gtk.h b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
index 9f52a6c..0168bbe 100644
--- a/chrome/browser/gtk/tabs/tab_renderer_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_renderer_gtk.h
@@ -14,6 +14,8 @@
#include "base/basictypes.h"
#include "base/gfx/rect.h"
#include "base/string16.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
#include "chrome/common/owned_widget_gtk.h"
#include "third_party/skia/include/core/SkBitmap.h"
@@ -34,9 +36,12 @@ class TabRendererGtk : public AnimationDelegate {
ANIMATION_LOADING
};
- class LoadingAnimation {
+ class LoadingAnimation : public NotificationObserver {
public:
struct Data {
+ explicit Data(ThemeProvider* theme_provider);
+ Data(int loading, int waiting, int waiting_to_loading);
+
SkBitmap* waiting_animation_frames;
SkBitmap* loading_animation_frames;
int loading_animation_frame_count;
@@ -44,7 +49,10 @@ class TabRendererGtk : public AnimationDelegate {
int waiting_to_loading_frame_count_ratio;
};
- explicit LoadingAnimation(const Data* data);
+ explicit LoadingAnimation(ThemeProvider* theme_provider);
+
+ // Used in unit tests to inject specific data.
+ explicit LoadingAnimation(const LoadingAnimation::Data& data);
// Advance the loading animation to the next frame, or hide the animation if
// the tab isn't loading.
@@ -60,8 +68,19 @@ class TabRendererGtk : public AnimationDelegate {
return data_->loading_animation_frames;
}
+ // Provide NotificationObserver implementation.
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
private:
- const Data* const data_;
+ scoped_ptr<Data> data_;
+
+ // Used to listen for theme change notifications.
+ NotificationRegistrar registrar_;
+
+ // Gives us our throbber images.
+ ThemeProvider* theme_provider_;
// Current state of the animation.
AnimationState animation_state_;
@@ -72,7 +91,7 @@ class TabRendererGtk : public AnimationDelegate {
DISALLOW_COPY_AND_ASSIGN(LoadingAnimation);
};
- TabRendererGtk();
+ explicit TabRendererGtk(ThemeProvider* theme_provider);
virtual ~TabRendererGtk();
// TabContents. If only the loading state was updated, the loading_only flag