Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc

Issue 1492043002: Introduced switches for Master/Slave bootstrapping process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverted unnecessary changes back. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 "Slave" device. The locale &
208 // input of the remora device is set up by a shark device. In this case we 208 // input of the "Slave" device is set up by a "Master" device. In this case we
209 // don't want EnableLoginLayout() to reset the input method to the hardware 209 // don't want EnableLoginLayout() to reset the input method to the hardware
210 // default method. 210 // default method.
211 const bool is_remora = g_browser_process->platform_part() 211 const bool is_slave = base::CommandLine::ForCurrentProcess()->HasSwitch(
achuithb 2015/12/04 09:14:11 Shouldn't we keep this logic as well?
xdai1 2015/12/04 19:04:15 Yes, probably I should not delete this logic. Base
Alexander Alekseev 2015/12/05 00:04:14 I don't understand this. Do you mean "by connectin
212 ->browser_policy_connector_chromeos() 212 chromeos::switches::kOobeBootstrappingSlave);
213 ->GetDeviceCloudPolicyManager()
214 ->IsRemoraRequisition();
215 213
216 const bool enable_layouts = 214 const bool enable_layouts =
217 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_remora; 215 !user_manager::UserManager::Get()->IsUserLoggedIn() && !is_slave;
achuithb 2015/12/04 09:14:11 && !is_remora as well?
218 216
219 dict->Set("languageList", language_list.release()); 217 dict->Set("languageList", language_list.release());
220 dict->Set( 218 dict->Set(
221 "inputMethodsList", 219 "inputMethodsList",
222 GetAndActivateLoginKeyboardLayouts( 220 GetAndActivateLoginKeyboardLayouts(
223 application_locale, selected_input_method, enable_layouts).release()); 221 application_locale, selected_input_method, enable_layouts).release());
224 dict->Set("timezoneList", GetTimezoneList()); 222 dict->Set("timezoneList", GetTimezoneList());
225 } 223 }
226 224
227 void NetworkScreenHandler::Initialize() { 225 void NetworkScreenHandler::Initialize() {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 timezone_option->SetString("value", timezone_id); 257 timezone_option->SetString("value", timezone_id);
260 timezone_option->SetString("title", timezone_name); 258 timezone_option->SetString("title", timezone_name);
261 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id); 259 timezone_option->SetBoolean("selected", timezone_id == current_timezone_id);
262 timezone_list->Append(timezone_option.release()); 260 timezone_list->Append(timezone_option.release());
263 } 261 }
264 262
265 return timezone_list.release(); 263 return timezone_list.release();
266 } 264 }
267 265
268 } // namespace chromeos 266 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698