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

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

Issue 12211105: Move remaining non-test, non-Chrome-specific Prefs code to base/prefs/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments, merge to LKGR. Created 7 years, 10 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/power/session_length_limiter.h" 5 #include "chrome/browser/chromeos/power/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/prefs/pref_registry_simple.h"
14 #include "base/prefs/pref_service.h"
13 #include "base/prefs/public/pref_service_base.h" 15 #include "base/prefs/public/pref_service_base.h"
14 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/lifetime/application_lifetime.h" 17 #include "chrome/browser/lifetime/application_lifetime.h"
16 #include "chrome/browser/prefs/pref_registry_simple.h"
17 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
19 19
20 namespace chromeos { 20 namespace chromeos {
21 21
22 namespace { 22 namespace {
23 23
24 // The minimum session time limit that can be set. 24 // The minimum session time limit that can be set.
25 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds. 25 const int kSessionLengthLimitMinMs = 30 * 1000; // 30 seconds.
26 26
27 // The maximum session time limit that can be set. 27 // The maximum session time limit that can be set.
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 (delegate_->GetCurrentTime() - session_start_time_); 157 (delegate_->GetCurrentTime() - session_start_time_);
158 if (remaining < kZeroTimeDelta) 158 if (remaining < kZeroTimeDelta)
159 remaining = kZeroTimeDelta; 159 remaining = kZeroTimeDelta;
160 160
161 // End the session if the remaining time reaches zero. 161 // End the session if the remaining time reaches zero.
162 if (remaining == base::TimeDelta()) 162 if (remaining == base::TimeDelta())
163 delegate_->StopSession(); 163 delegate_->StopSession();
164 } 164 }
165 165
166 } // namespace chromeos 166 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/network_message_observer.cc ('k') | chrome/browser/chromeos/power/suspend_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698