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/oobe_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 // If we're not doing boot animation then WebUI should trigger | 324 // If we're not doing boot animation then WebUI should trigger |
325 // wallpaper load on boot. | 325 // wallpaper load on boot. |
326 if (CommandLine::ForCurrentProcess()->HasSwitch( | 326 if (CommandLine::ForCurrentProcess()->HasSwitch( |
327 switches::kDisableBootAnimation)) { | 327 switches::kDisableBootAnimation)) { |
328 localized_strings->SetString("bootIntoWallpaper", "on"); | 328 localized_strings->SetString("bootIntoWallpaper", "on"); |
329 } else { | 329 } else { |
330 localized_strings->SetString("bootIntoWallpaper", "off"); | 330 localized_strings->SetString("bootIntoWallpaper", "off"); |
331 } | 331 } |
332 | 332 |
333 // TODO(nkostylev): Make sure that only one type of login UI | |
334 // is active at a time. | |
335 // OobeUI is used for these use cases: | |
336 // 1. Out-of-box / login | |
337 // 2. Lock screen. | |
338 // 3. Multi-profiles sign in (add user to current session). | |
339 if (LoginDisplayHostImpl::default_host()) { | |
340 if (!UserManager::Get()->IsUserLoggedIn()) | |
341 localized_strings->SetString("screenType", "login"); | |
342 else | |
343 localized_strings->SetString("screenType", "login-add-user"); | |
344 } else { | |
345 localized_strings->SetString("screenType", "lock"); | |
346 } | |
347 | |
348 bool keyboard_driven_oobe = false; | 333 bool keyboard_driven_oobe = false; |
349 system::StatisticsProvider::GetInstance()->GetMachineFlag( | 334 system::StatisticsProvider::GetInstance()->GetMachineFlag( |
350 chromeos::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe); | 335 chromeos::kOemKeyboardDrivenOobeKey, &keyboard_driven_oobe); |
351 localized_strings->SetString("highlightStrength", | 336 localized_strings->SetString("highlightStrength", |
352 keyboard_driven_oobe ? "strong" : "normal"); | 337 keyboard_driven_oobe ? "strong" : "normal"); |
353 } | 338 } |
354 | 339 |
355 void OobeUI::InitializeScreenMaps() { | 340 void OobeUI::InitializeScreenMaps() { |
356 screen_names_.resize(SCREEN_UNKNOWN); | 341 screen_names_.resize(SCREEN_UNKNOWN); |
357 screen_names_[SCREEN_OOBE_NETWORK] = kScreenOobeNetwork; | 342 screen_names_[SCREEN_OOBE_NETWORK] = kScreenOobeNetwork; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 void OobeUI::OnCurrentScreenChanged(const std::string& screen) { | 410 void OobeUI::OnCurrentScreenChanged(const std::string& screen) { |
426 if (screen_ids_.count(screen)) { | 411 if (screen_ids_.count(screen)) { |
427 current_screen_ = screen_ids_[screen]; | 412 current_screen_ = screen_ids_[screen]; |
428 } else { | 413 } else { |
429 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()"; | 414 NOTREACHED() << "Screen should be registered in InitializeScreenMaps()"; |
430 current_screen_ = SCREEN_UNKNOWN; | 415 current_screen_ = SCREEN_UNKNOWN; |
431 } | 416 } |
432 } | 417 } |
433 | 418 |
434 } // namespace chromeos | 419 } // namespace chromeos |
OLD | NEW |