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

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

Issue 1130173002: Files.app: Relax condtion to skip OOBE demo mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« 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 21 matching lines...) Expand all
32 DemoModeDetector::~DemoModeDetector() { 32 DemoModeDetector::~DemoModeDetector() {
33 } 33 }
34 34
35 // Public methods. 35 // Public methods.
36 36
37 void DemoModeDetector::InitDetection() { 37 void DemoModeDetector::InitDetection() {
38 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 38 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
39 switches::kDisableDemoMode)) 39 switches::kDisableDemoMode))
40 return; 40 return;
41 41
42 if (base::SysInfo::IsRunningOnChromeOS()) { 42 const bool has_derelict_switch =
43 base::CommandLine::ForCurrentProcess()->HasSwitch(
44 switches::kDerelictDetectionTimeout) ||
45 base::CommandLine::ForCurrentProcess()->HasSwitch(
46 switches::kDerelictIdleTimeout);
47
48 if (base::SysInfo::IsRunningOnChromeOS() && !has_derelict_switch) {
43 std::string track; 49 std::string track;
44 // We're running on an actual device; if we cannot find our release track 50 // We're running on an actual device; if we cannot find our release track
45 // value or if the track contains "testimage", don't start demo mode. 51 // value or if the track contains "testimage", don't start demo mode.
46 if (!base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK", &track) || 52 if (!base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK", &track) ||
47 track.find("testimage") != std::string::npos) 53 track.find("testimage") != std::string::npos)
48 return; 54 return;
49 } 55 }
50 56
51 if (IsDerelict()) 57 if (IsDerelict())
52 StartIdleDetection(); 58 StartIdleDetection();
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 std::max(std::min(oobe_timer_update_interval_, 154 std::max(std::min(oobe_timer_update_interval_,
149 derelict_detection_timeout_ - time_on_oobe_), 155 derelict_detection_timeout_ - time_on_oobe_),
150 base::TimeDelta::FromSeconds(0)); 156 base::TimeDelta::FromSeconds(0));
151 } 157 }
152 158
153 bool DemoModeDetector::IsDerelict() { 159 bool DemoModeDetector::IsDerelict() {
154 return time_on_oobe_ >= derelict_detection_timeout_; 160 return time_on_oobe_ >= derelict_detection_timeout_;
155 } 161 }
156 162
157 } // namespace chromeos 163 } // 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