Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Side by Side Diff: views/repeat_controller.h

Issue 8771006: views: Move the remaining file from views/ to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/painter.cc ('k') | views/repeat_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef VIEWS_REPEAT_CONTROLLER_H_
6 #define VIEWS_REPEAT_CONTROLLER_H_
7 #pragma once
8
9 #include "base/callback.h"
10 #include "base/timer.h"
11
12 namespace views {
13
14 ///////////////////////////////////////////////////////////////////////////////
15 //
16 // RepeatController
17 //
18 // An object that handles auto-repeating UI actions. There is a longer initial
19 // delay after which point repeats become constant. Users provide a callback
20 // that is notified when each repeat occurs so that they can perform the
21 // associated action.
22 //
23 ///////////////////////////////////////////////////////////////////////////////
24 class RepeatController {
25 public:
26 // The RepeatController takes ownership of this callback object.
27 explicit RepeatController(const base::Closure& callback);
28 virtual ~RepeatController();
29
30 // Start repeating.
31 void Start();
32
33 // Stop repeating.
34 void Stop();
35
36 private:
37 // Called when the timer expires.
38 void Run();
39
40 // The current timer.
41 base::OneShotTimer<RepeatController> timer_;
42
43 base::Closure callback_;
44
45 DISALLOW_COPY_AND_ASSIGN(RepeatController);
46 };
47
48 } // namespace views
49
50 #endif // #ifndef VIEWS_REPEAT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « views/painter.cc ('k') | views/repeat_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698