diff options
author | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-03 18:18:14 +0000 |
---|---|---|
committer | darin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-03 18:18:14 +0000 |
commit | 2d31666a58e746b7a1d415c99e5f68ad9256d236 (patch) | |
tree | 144c99d4b80df0f0f9a3ded83f9d21a8b36f17cc /chrome/views/repeat_controller.h | |
parent | 90d6958fe2374a00d3c8583cf4d3b8a509ae8e90 (diff) | |
download | chromium_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/repeat_controller.h')
-rw-r--r-- | chrome/views/repeat_controller.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/chrome/views/repeat_controller.h b/chrome/views/repeat_controller.h index 69c539a..92434f6 100644 --- a/chrome/views/repeat_controller.h +++ b/chrome/views/repeat_controller.h @@ -2,11 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_VIEWS_REPEAT_CONTROLLER_H__ -#define CHROME_VIEWS_REPEAT_CONTROLLER_H__ +#ifndef CHROME_VIEWS_REPEAT_CONTROLLER_H_ +#define CHROME_VIEWS_REPEAT_CONTROLLER_H_ -#include "base/message_loop.h" -#include "base/task.h" +#include "base/timer.h" namespace ChromeViews { @@ -20,7 +19,7 @@ namespace ChromeViews { // associated action. // /////////////////////////////////////////////////////////////////////////////// -class RepeatController : public Task { +class RepeatController { public: typedef Callback0::Type RepeatCallback; @@ -34,24 +33,20 @@ class RepeatController : public Task { // Stop repeating. void Stop(); - // Task implementation: - void Run(); - private: RepeatController(); - // Stop and delete the timer. - void DestroyTimer(); + // Called when the timer expires. + void Run(); // The current timer. - Timer* timer_; + base::OneShotTimer<RepeatController> timer_; scoped_ptr<RepeatCallback> callback_; - DISALLOW_EVIL_CONSTRUCTORS(RepeatController); + DISALLOW_COPY_AND_ASSIGN(RepeatController); }; -} - -#endif // #ifndef CHROME_VIEWS_REPEAT_CONTROLLER_H__ +} // namespace ChromeViews +#endif // #ifndef CHROME_VIEWS_REPEAT_CONTROLLER_H_ |