OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/views/repeat_controller.h" | 5 #include "chrome/views/repeat_controller.h" |
6 | 6 |
| 7 using base::TimeDelta; |
| 8 |
7 namespace views { | 9 namespace views { |
8 | 10 |
9 // The delay before the first and then subsequent repeats. Values taken from | 11 // The delay before the first and then subsequent repeats. Values taken from |
10 // XUL code: http://mxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsRepea
tService.cpp#52 | 12 // XUL code: http://mxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsRepea
tService.cpp#52 |
11 static const int kInitialRepeatDelay = 250; | 13 static const int kInitialRepeatDelay = 250; |
12 static const int kRepeatDelay = 50; | 14 static const int kRepeatDelay = 50; |
13 | 15 |
14 /////////////////////////////////////////////////////////////////////////////// | 16 /////////////////////////////////////////////////////////////////////////////// |
15 // RepeatController, public: | 17 // RepeatController, public: |
16 | 18 |
(...skipping 17 matching lines...) Expand all Loading... |
34 /////////////////////////////////////////////////////////////////////////////// | 36 /////////////////////////////////////////////////////////////////////////////// |
35 // RepeatController, private: | 37 // RepeatController, private: |
36 | 38 |
37 void RepeatController::Run() { | 39 void RepeatController::Run() { |
38 timer_.Start(TimeDelta::FromMilliseconds(kRepeatDelay), this, | 40 timer_.Start(TimeDelta::FromMilliseconds(kRepeatDelay), this, |
39 &RepeatController::Run); | 41 &RepeatController::Run); |
40 callback_->Run(); | 42 callback_->Run(); |
41 } | 43 } |
42 | 44 |
43 } // namespace views | 45 } // namespace views |
OLD | NEW |