| 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 a "Slave" device. The locale & | 210 // 3) This is the bootstrapping process for the remora/"Slave" device. The |
| 211 // input of the "Slave" device is set up by a "Master" device. In this case we | 211 // locale & input of the remora/"Slave" device is set up by a shark/"Master" |
| 212 // don't want EnableLoginLayout() to reset the input method to the hardware | 212 // device. In this case we don't want EnableLoginLayout() to reset the input |
| 213 // default method. | 213 // method to the hardware default method. |
| 214 const bool is_slave = g_browser_process->local_state()->GetBoolean( | 214 const bool is_remora = g_browser_process->platform_part() |
| 215 prefs::kOobeControllerDetected); | 215 ->browser_policy_connector_chromeos() |
| 216 ->GetDeviceCloudPolicyManager() |
| 217 ->IsRemoraRequisition(); |
| 218 |
| 219 const bool is_slave = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 220 chromeos::switches::kOobeBootstrappingSlave); |
| 216 | 221 |
| 217 const bool enable_layouts = | 222 const bool enable_layouts = |
| 218 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_slave; | 223 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_slave && |
| 224 !is_remora; |
| 219 | 225 |
| 220 dict->Set("languageList", language_list.release()); | 226 dict->Set("languageList", language_list.release()); |
| 221 dict->Set( | 227 dict->Set( |
| 222 "inputMethodsList", | 228 "inputMethodsList", |
| 223 GetAndActivateLoginKeyboardLayouts( | 229 GetAndActivateLoginKeyboardLayouts( |
| 224 application_locale, selected_input_method, enable_layouts).release()); | 230 application_locale, selected_input_method, enable_layouts).release()); |
| 225 dict->Set("timezoneList", GetTimezoneList()); | 231 dict->Set("timezoneList", GetTimezoneList()); |
| 226 } | 232 } |
| 227 | 233 |
| 228 void NetworkScreenHandler::Initialize() { | 234 void NetworkScreenHandler::Initialize() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 timezone_option->SetString("value", timezone_id); | 266 timezone_option->SetString("value", timezone_id); |
| 261 timezone_option->SetString("title", timezone_name); | 267 timezone_option->SetString("title", timezone_name); |
| 262 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); | 268 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); |
| 263 timezone_list->Append(timezone_option.release()); | 269 timezone_list->Append(timezone_option.release()); |
| 264 } | 270 } |
| 265 | 271 |
| 266 return timezone_list.release(); | 272 return timezone_list.release(); |
| 267 } | 273 } |
| 268 | 274 |
| 269 } // namespace chromeos | 275 } // namespace chromeos |
| OLD | NEW |