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

Side by Side Diff: chrome/browser/chromeos/session_length_limiter.cc

Issue 222383002: Move UserActivityDetector from ash/wm/ to ui/wm/core/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove an unneeded include Created 6 years, 8 months 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
OLDNEW
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 "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/wm/user_activity_detector.h"
11 #include "base/bind.h" 10 #include "base/bind.h"
12 #include "base/bind_helpers.h" 11 #include "base/bind_helpers.h"
13 #include "base/location.h" 12 #include "base/location.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
15 #include "base/prefs/pref_registry_simple.h" 14 #include "base/prefs/pref_registry_simple.h"
16 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
17 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
18 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
19 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
20 #include "ui/events/event.h" 19 #include "ui/events/event.h"
20 #include "ui/wm/core/user_activity_detector.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
29 // The maximum session time limit that can be set. 29 // The maximum session time limit that can be set.
30 const int kSessionLengthLimitMaxMs = 24 * 60 * 60 * 1000; // 24 hours. 30 const int kSessionLengthLimitMaxMs = 24 * 60 * 60 * 1000; // 24 hours.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<SessionLengthLimiter::Delegate>); 208 timer_.reset(new base::OneShotTimer<SessionLengthLimiter::Delegate>);
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698