summaryrefslogtreecommitdiffstats
path: root/chrome/views/throbber.h
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
commit2d31666a58e746b7a1d415c99e5f68ad9256d236 (patch)
tree144c99d4b80df0f0f9a3ded83f9d21a8b36f17cc /chrome/views/throbber.h
parent90d6958fe2374a00d3c8583cf4d3b8a509ae8e90 (diff)
downloadchromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.zip
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.gz
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.bz2
Minor cleanup to OneShotTimer and RepeatingTimer: moves more of the member variables into the Task subclass.
Also included in this change: deprecate MessageLoop::timer_manager(), and change consumers over to use OneShotTimer or RepeatingTimer. R=beng BUG=1346553 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/throbber.h')
-rw-r--r--chrome/views/throbber.h22
1 files changed, 7 insertions, 15 deletions
diff --git a/chrome/views/throbber.h b/chrome/views/throbber.h
index 812cae1..3c42fde 100644
--- a/chrome/views/throbber.h
+++ b/chrome/views/throbber.h
@@ -8,19 +8,14 @@
#define CHROME_VIEWS_THROBBER_H__
#include "base/basictypes.h"
-#include "base/task.h"
+#include "base/timer.h"
#include "chrome/views/view.h"
class SkBitmap;
-namespace base {
-class Timer;
-}
-
namespace ChromeViews {
-class Throbber : public ChromeViews::View,
- public Task {
+class Throbber : public ChromeViews::View {
public:
// |frame_time_ms| is the amount of time that should elapse between frames
// (in milliseconds)
@@ -37,14 +32,13 @@ class Throbber : public ChromeViews::View,
virtual void GetPreferredSize(CSize *out);
virtual void Paint(ChromeCanvas* canvas);
- // implemented from Task
- virtual void Run();
-
protected:
// Specifies whether the throbber is currently animating or not
bool running_;
private:
+ void Run();
+
bool paint_while_stopped_;
int frame_count_;
int last_frame_drawn_;
@@ -52,7 +46,7 @@ class Throbber : public ChromeViews::View,
DWORD last_time_recorded_;
SkBitmap* frames_;
int frame_time_ms_;
- base::Timer* timer_;
+ base::RepeatingTimer<Throbber> timer_;
DISALLOW_EVIL_CONSTRUCTORS(Throbber);
};
@@ -77,10 +71,8 @@ class SmoothedThrobber : public Throbber {
// This function stops the actual throbbing.
void StopDelayOver();
- // Method factory for delaying throbber startup.
- ScopedRunnableMethodFactory<SmoothedThrobber> start_delay_factory_;
- // Method factory for delaying throbber shutdown.
- ScopedRunnableMethodFactory<SmoothedThrobber> end_delay_factory_;
+ base::OneShotTimer<SmoothedThrobber> start_timer_;
+ base::OneShotTimer<SmoothedThrobber> stop_timer_;
DISALLOW_EVIL_CONSTRUCTORS(SmoothedThrobber);
};