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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/demo_mode_detector.cc

Issue 821013002: Stop demo mode detection correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/webui/chromeos/login/demo_mode_detector.h" 5 #include "chrome/browser/ui/webui/chromeos/login/demo_mode_detector.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_registry_simple.h" 8 #include "base/prefs/pref_registry_simple.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return; 47 return;
48 } 48 }
49 49
50 if (IsDerelict()) 50 if (IsDerelict())
51 StartIdleDetection(); 51 StartIdleDetection();
52 else 52 else
53 StartOobeTimer(); 53 StartOobeTimer();
54 } 54 }
55 55
56 void DemoModeDetector::StopDetection() { 56 void DemoModeDetector::StopDetection() {
57 oobe_timer_.Stop();
57 idle_detector_.reset(); 58 idle_detector_.reset();
58 } 59 }
59 60
60 // static 61 // static
61 void DemoModeDetector::RegisterPrefs(PrefRegistrySimple* registry) { 62 void DemoModeDetector::RegisterPrefs(PrefRegistrySimple* registry) {
62 registry->RegisterInt64Pref(prefs::kTimeOnOobe, 0); 63 registry->RegisterInt64Pref(prefs::kTimeOnOobe, 0);
63 } 64 }
64 65
65 // Private methods. 66 // Private methods.
66 67
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::max(std::min(oobe_timer_update_interval_, 147 std::max(std::min(oobe_timer_update_interval_,
147 derelict_detection_timeout_ - time_on_oobe_), 148 derelict_detection_timeout_ - time_on_oobe_),
148 base::TimeDelta::FromSeconds(0)); 149 base::TimeDelta::FromSeconds(0));
149 } 150 }
150 151
151 bool DemoModeDetector::IsDerelict() { 152 bool DemoModeDetector::IsDerelict() {
152 return time_on_oobe_ >= derelict_detection_timeout_; 153 return time_on_oobe_ >= derelict_detection_timeout_;
153 } 154 }
154 155
155 } // namespace chromeos 156 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698