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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | |
10 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
11 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
12 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
13 #include "base/sys_info.h" | |
14 #include "base/values.h" | 12 #include "base/values.h" |
15 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 14 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
17 #include "chrome/browser/chromeos/base/locale_util.h" | 15 #include "chrome/browser/chromeos/base/locale_util.h" |
18 #include "chrome/browser/chromeos/customization_document.h" | 16 #include "chrome/browser/chromeos/customization_document.h" |
19 #include "chrome/browser/chromeos/idle_detector.h" | 17 #include "chrome/browser/chromeos/idle_detector.h" |
20 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 18 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
21 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 19 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
22 #include "chrome/browser/chromeos/system/input_device_settings.h" | 20 #include "chrome/browser/chromeos/system/input_device_settings.h" |
23 #include "chrome/browser/chromeos/system/timezone_util.h" | 21 #include "chrome/browser/chromeos/system/timezone_util.h" |
24 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 22 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 23 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
26 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
27 #include "chrome/grit/generated_resources.h" | 25 #include "chrome/grit/generated_resources.h" |
28 #include "chromeos/chromeos_switches.h" | |
29 #include "chromeos/ime/extension_ime_util.h" | 26 #include "chromeos/ime/extension_ime_util.h" |
30 #include "chromeos/network/network_handler.h" | 27 #include "chromeos/network/network_handler.h" |
31 #include "chromeos/network/network_state_handler.h" | 28 #include "chromeos/network/network_state_handler.h" |
32 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
33 #include "ui/gfx/rect.h" | 30 #include "ui/gfx/rect.h" |
34 #include "ui/views/layout/fill_layout.h" | 31 #include "ui/views/layout/fill_layout.h" |
35 #include "ui/views/widget/widget.h" | 32 #include "ui/views/widget/widget.h" |
36 | 33 |
37 namespace { | 34 namespace { |
38 | 35 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return; | 117 return; |
121 } | 118 } |
122 | 119 |
123 // Make sure all our network technologies are turned on. On OOBE, the user | 120 // Make sure all our network technologies are turned on. On OOBE, the user |
124 // should be able to select any of the available networks on the device. | 121 // should be able to select any of the available networks on the device. |
125 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); | 122 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
126 handler->SetTechnologyEnabled(NetworkTypePattern::NonVirtual(), | 123 handler->SetTechnologyEnabled(NetworkTypePattern::NonVirtual(), |
127 true, | 124 true, |
128 chromeos::network_handler::ErrorCallback()); | 125 chromeos::network_handler::ErrorCallback()); |
129 ShowScreen(OobeUI::kScreenOobeNetwork, NULL); | 126 ShowScreen(OobeUI::kScreenOobeNetwork, NULL); |
130 | |
131 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableDemoMode)) | |
132 return; | |
133 if (base::SysInfo::IsRunningOnChromeOS()) { | |
134 std::string track; | |
135 // We're running on an actual device; if we cannot find our release track | |
136 // value or if the track contains "testimage", don't start demo mode. | |
137 if (!base::SysInfo::GetLsbReleaseValue("CHROMEOS_RELEASE_TRACK", &track) || | |
138 track.find("testimage") != std::string::npos) | |
139 return; | |
140 } | |
141 core_oobe_actor_->InitDemoModeDetection(); | 127 core_oobe_actor_->InitDemoModeDetection(); |
142 } | 128 } |
143 | 129 |
144 void NetworkScreenHandler::Hide() { | 130 void NetworkScreenHandler::Hide() { |
145 } | 131 } |
146 | 132 |
147 void NetworkScreenHandler::ShowError(const base::string16& message) { | 133 void NetworkScreenHandler::ShowError(const base::string16& message) { |
148 CallJS("showError", message); | 134 CallJS("showError", message); |
149 } | 135 } |
150 | 136 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 timezone_option->SetString("value", timezone_id); | 349 timezone_option->SetString("value", timezone_id); |
364 timezone_option->SetString("title", timezone_name); | 350 timezone_option->SetString("title", timezone_name); |
365 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); | 351 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); |
366 timezone_list->Append(timezone_option.release()); | 352 timezone_list->Append(timezone_option.release()); |
367 } | 353 } |
368 | 354 |
369 return timezone_list.release(); | 355 return timezone_list.release(); |
370 } | 356 } |
371 | 357 |
372 } // namespace chromeos | 358 } // namespace chromeos |
OLD | NEW |