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