OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |