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" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // But after public user session is started, "Terms of Service" dialog is | 197 // But after public user session is started, "Terms of Service" dialog is |
198 // shown. It is a part of OOBE UI screens, so it initiates reload of UI | 198 // shown. It is a part of OOBE UI screens, so it initiates reload of UI |
199 // strings in new locale. It also happens asynchronously, that leads to race | 199 // strings in new locale. It also happens asynchronously, that leads to race |
200 // between "locale change", "input method change" and | 200 // between "locale change", "input method change" and |
201 // "EnableLoginLayouts()". This way EnableLoginLayouts() happens after user | 201 // "EnableLoginLayouts()". This way EnableLoginLayouts() happens after user |
202 // input method has been changed, resetting input method to hardware default. | 202 // input method has been changed, resetting input method to hardware default. |
203 // | 203 // |
204 // So we need to disable activation of login layouts if we are already in | 204 // So we need to disable activation of login layouts if we are already in |
205 // active user session. | 205 // active user session. |
206 // | 206 // |
207 // 3) This is the bootstrapping process for the remora device. The locale & | 207 // 3) This is the bootstrapping process for the remora/"Slave" device. The |
208 // input of the remora device is set up by a shark device. In this case we | 208 // locale & input of the remora/"Slave" device is set up by a shark/"Master" |
209 // don't want EnableLoginLayout() to reset the input method to the hardware | 209 // device. In this case we don't want EnableLoginLayout() to reset the input |
210 // default method. | 210 // method to the hardware default method. |
211 const bool is_remora = g_browser_process->platform_part() | 211 const bool is_remora = g_browser_process->platform_part() |
212 ->browser_policy_connector_chromeos() | 212 ->browser_policy_connector_chromeos() |
213 ->GetDeviceCloudPolicyManager() | 213 ->GetDeviceCloudPolicyManager() |
214 ->IsRemoraRequisition(); | 214 ->IsRemoraRequisition(); |
215 | 215 |
| 216 const bool is_slave = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 217 chromeos::switches::kOobeBootstrappingSlave); |
| 218 |
216 const bool enable_layouts = | 219 const bool enable_layouts = |
217 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_remora; | 220 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_slave && |
| 221 !is_remora; |
218 | 222 |
219 dict->Set("languageList", language_list.release()); | 223 dict->Set("languageList", language_list.release()); |
220 dict->Set( | 224 dict->Set( |
221 "inputMethodsList", | 225 "inputMethodsList", |
222 GetAndActivateLoginKeyboardLayouts( | 226 GetAndActivateLoginKeyboardLayouts( |
223 application_locale, selected_input_method, enable_layouts).release()); | 227 application_locale, selected_input_method, enable_layouts).release()); |
224 dict->Set("timezoneList", GetTimezoneList()); | 228 dict->Set("timezoneList", GetTimezoneList()); |
225 } | 229 } |
226 | 230 |
227 void NetworkScreenHandler::Initialize() { | 231 void NetworkScreenHandler::Initialize() { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 timezone_option->SetString("value", timezone_id); | 263 timezone_option->SetString("value", timezone_id); |
260 timezone_option->SetString("title", timezone_name); | 264 timezone_option->SetString("title", timezone_name); |
261 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); | 265 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); |
262 timezone_list->Append(timezone_option.release()); | 266 timezone_list->Append(timezone_option.release()); |
263 } | 267 } |
264 | 268 |
265 return timezone_list.release(); | 269 return timezone_list.release(); |
266 } | 270 } |
267 | 271 |
268 } // namespace chromeos | 272 } // namespace chromeos |
OLD | NEW |