OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 void Start(const base::TimeDelta& timeout); | 22 void Start(const base::TimeDelta& timeout); |
23 | 23 |
24 private: | 24 private: |
25 // ui::UserActivityObserver overrides: | 25 // ui::UserActivityObserver overrides: |
26 void OnUserActivity(const ui::Event* event) override; | 26 void OnUserActivity(const ui::Event* event) override; |
27 | 27 |
28 // Resets |timer_| to fire when we reach our idle timeout. | 28 // Resets |timer_| to fire when we reach our idle timeout. |
29 void ResetTimer(); | 29 void ResetTimer(); |
30 | 30 |
31 base::OneShotTimer<IdleDetector> timer_; | 31 base::OneShotTimer timer_; |
32 | 32 |
33 base::Closure idle_callback_; | 33 base::Closure idle_callback_; |
34 | 34 |
35 base::TimeDelta timeout_; | 35 base::TimeDelta timeout_; |
36 | 36 |
37 DISALLOW_COPY_AND_ASSIGN(IdleDetector); | 37 DISALLOW_COPY_AND_ASSIGN(IdleDetector); |
38 }; | 38 }; |
39 | 39 |
40 } // namespace chromeos | 40 } // namespace chromeos |
41 | 41 |
42 #endif // CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ | 42 #endif // CHROME_BROWSER_CHROMEOS_IDLE_DETECTOR_H_ |
OLD | NEW |