OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SESSION_LENGTH_LIMITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SESSION_LENGTH_LIMITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SESSION_LENGTH_LIMITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SESSION_LENGTH_LIMITER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 11 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
13 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
14 #include "components/prefs/pref_change_registrar.h" | 15 #include "components/prefs/pref_change_registrar.h" |
15 #include "ui/base/user_activity/user_activity_observer.h" | 16 #include "ui/base/user_activity/user_activity_observer.h" |
16 | 17 |
17 class PrefService; | 18 class PrefService; |
18 class PrefRegistrySimple; | 19 class PrefRegistrySimple; |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // time is set and persisted in local state the first time this method is | 54 // time is set and persisted in local state the first time this method is |
54 // called. | 55 // called. |
55 // The pref indicating whether to wait for initial user activity may change at | 56 // The pref indicating whether to wait for initial user activity may change at |
56 // any time, switching between the two behaviors. | 57 // any time, switching between the two behaviors. |
57 void UpdateSessionStartTime(); | 58 void UpdateSessionStartTime(); |
58 | 59 |
59 void UpdateLimit(); | 60 void UpdateLimit(); |
60 | 61 |
61 base::ThreadChecker thread_checker_; | 62 base::ThreadChecker thread_checker_; |
62 | 63 |
63 scoped_ptr<Delegate> delegate_; | 64 std::unique_ptr<Delegate> delegate_; |
64 PrefChangeRegistrar pref_change_registrar_; | 65 PrefChangeRegistrar pref_change_registrar_; |
65 | 66 |
66 scoped_ptr<base::OneShotTimer> timer_; | 67 std::unique_ptr<base::OneShotTimer> timer_; |
67 base::TimeTicks session_start_time_; | 68 base::TimeTicks session_start_time_; |
68 bool user_activity_seen_; | 69 bool user_activity_seen_; |
69 | 70 |
70 DISALLOW_COPY_AND_ASSIGN(SessionLengthLimiter); | 71 DISALLOW_COPY_AND_ASSIGN(SessionLengthLimiter); |
71 }; | 72 }; |
72 | 73 |
73 } // namespace chromeos | 74 } // namespace chromeos |
74 | 75 |
75 #endif // CHROME_BROWSER_CHROMEOS_SESSION_LENGTH_LIMITER_H_ | 76 #endif // CHROME_BROWSER_CHROMEOS_SESSION_LENGTH_LIMITER_H_ |
OLD | NEW |