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

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

Issue 270973002: Don't start demo mode on a test image. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« 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 (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/ui/webui/chromeos/login/network_screen_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.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/command_line.h" 11 #include "base/command_line.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/prefs/pref_registry_simple.h" 14 #include "base/prefs/pref_registry_simple.h"
15 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
16 #include "base/strings/string_number_conversions.h" 16 #include "base/strings/string_number_conversions.h"
17 #include "base/strings/stringprintf.h" 17 #include "base/strings/stringprintf.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "base/sys_info.h"
19 #include "base/values.h" 20 #include "base/values.h"
20 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 22 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
22 #include "chrome/browser/chromeos/base/locale_util.h" 23 #include "chrome/browser/chromeos/base/locale_util.h"
23 #include "chrome/browser/chromeos/idle_detector.h" 24 #include "chrome/browser/chromeos/idle_detector.h"
24 #include "chrome/browser/chromeos/input_method/input_method_util.h" 25 #include "chrome/browser/chromeos/input_method/input_method_util.h"
25 #include "chrome/browser/chromeos/login/input_events_blocker.h" 26 #include "chrome/browser/chromeos/login/input_events_blocker.h"
26 #include "chrome/browser/chromeos/login/login_display_host.h" 27 #include "chrome/browser/chromeos/login/login_display_host.h"
27 #include "chrome/browser/chromeos/login/login_display_host_impl.h" 28 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
28 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" 29 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // Make sure all our network technologies are turned on. On OOBE, the user 159 // Make sure all our network technologies are turned on. On OOBE, the user
159 // should be able to select any of the available networks on the device. 160 // should be able to select any of the available networks on the device.
160 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); 161 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
161 handler->SetTechnologyEnabled(NetworkTypePattern::NonVirtual(), 162 handler->SetTechnologyEnabled(NetworkTypePattern::NonVirtual(),
162 true, 163 true,
163 chromeos::network_handler::ErrorCallback()); 164 chromeos::network_handler::ErrorCallback());
164 ShowScreen(OobeUI::kScreenOobeNetwork, NULL); 165 ShowScreen(OobeUI::kScreenOobeNetwork, NULL);
165 166
166 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableDemoMode)) 167 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableDemoMode))
167 return; 168 return;
169 if (base::SysInfo::IsRunningOnChromeOS()) {
170 std::string track;
171 // We're running on an actual device; if we cannot find our release track
172 // value or if the track contains "testimage", don't start demo mode.
173 if (!base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK", &track) ||
xiyuan 2014/05/09 01:08:17 nit: combine this and command line check into a he
rkc 2014/05/09 04:44:55 I would like to keep these here since there is vir
174 track.find("testimage") != std::string::npos)
175 return;
176 }
168 177
169 if (IsDerelict()) 178 if (IsDerelict())
170 StartIdleDetection(); 179 StartIdleDetection();
171 else 180 else
172 StartOobeTimer(); 181 StartOobeTimer();
173 } 182 }
174 183
175 void NetworkScreenHandler::Hide() { 184 void NetworkScreenHandler::Hide() {
176 } 185 }
177 186
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 timezone_option->SetString("value", timezone_id); 623 timezone_option->SetString("value", timezone_id);
615 timezone_option->SetString("title", timezone_name); 624 timezone_option->SetString("title", timezone_name);
616 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); 625 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id);
617 timezone_list->Append(timezone_option.release()); 626 timezone_list->Append(timezone_option.release());
618 } 627 }
619 628
620 return timezone_list.release(); 629 return timezone_list.release();
621 } 630 }
622 631
623 } // namespace chromeos 632 } // 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