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 #include "chrome/browser/chromeos/session_length_limiter.h" | 5 #include "chrome/browser/chromeos/session_length_limiter.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/prefs/pref_registry_simple.h" | |
15 #include "base/prefs/pref_service.h" | |
16 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/lifetime/application_lifetime.h" | 15 #include "chrome/browser/lifetime/application_lifetime.h" |
18 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "components/prefs/pref_registry_simple.h" |
| 18 #include "components/prefs/pref_service.h" |
19 #include "ui/base/user_activity/user_activity_detector.h" | 19 #include "ui/base/user_activity/user_activity_detector.h" |
20 #include "ui/events/event.h" | 20 #include "ui/events/event.h" |
21 | 21 |
22 namespace chromeos { | 22 namespace chromeos { |
23 | 23 |
24 namespace { | 24 namespace { |
25 | 25 |
26 // The minimum session time limit that can be set. | 26 // The minimum session time limit that can be set. |
27 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. | 27 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. |
28 | 28 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return; | 204 return; |
205 } | 205 } |
206 | 206 |
207 // Set a timer to log out the user when the session length limit is reached. | 207 // Set a timer to log out the user when the session length limit is reached. |
208 timer_.reset(new base::OneShotTimer); | 208 timer_.reset(new base::OneShotTimer); |
209 timer_->Start(FROM_HERE, remaining, delegate_.get(), | 209 timer_->Start(FROM_HERE, remaining, delegate_.get(), |
210 &SessionLengthLimiter::Delegate::StopSession); | 210 &SessionLengthLimiter::Delegate::StopSession); |
211 } | 211 } |
212 | 212 |
213 } // namespace chromeos | 213 } // namespace chromeos |
OLD | NEW |