| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 localized_strings->SetString("bootIntoWallpaper", "off"); | 505 localized_strings->SetString("bootIntoWallpaper", "off"); |
| 506 } | 506 } |
| 507 | 507 |
| 508 bool keyboard_driven_oobe = | 508 bool keyboard_driven_oobe = |
| 509 system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); | 509 system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); |
| 510 localized_strings->SetString("highlightStrength", | 510 localized_strings->SetString("highlightStrength", |
| 511 keyboard_driven_oobe ? "strong" : "normal"); | 511 keyboard_driven_oobe ? "strong" : "normal"); |
| 512 | 512 |
| 513 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 513 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
| 514 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); | 514 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); |
| 515 localized_strings->SetString( | 515 oobe_ui_md_mode_ = |
| 516 "newOobeUI", | 516 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode); |
| 517 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode) ? "on" | 517 localized_strings->SetString("newOobeUI", oobe_ui_md_mode_ ? "on" : "off"); |
| 518 : "off"); | |
| 519 } | 518 } |
| 520 | 519 |
| 521 void OobeUI::AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler) { | 520 void OobeUI::AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler) { |
| 522 handlers_.push_back(handler.get()); | 521 handlers_.push_back(handler.get()); |
| 523 web_ui()->AddMessageHandler(std::move(handler)); | 522 web_ui()->AddMessageHandler(std::move(handler)); |
| 524 } | 523 } |
| 525 | 524 |
| 526 void OobeUI::InitializeHandlers() { | 525 void OobeUI::InitializeHandlers() { |
| 527 ready_ = true; | 526 ready_ = true; |
| 528 for (size_t i = 0; i < ready_callbacks_.size(); ++i) | 527 for (size_t i = 0; i < ready_callbacks_.size(); ++i) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 // TODO: Ash needs to expose screen dimming api. See | 614 // TODO: Ash needs to expose screen dimming api. See |
| 616 // http://crbug.com/646034. | 615 // http://crbug.com/646034. |
| 617 NOTIMPLEMENTED(); | 616 NOTIMPLEMENTED(); |
| 618 } | 617 } |
| 619 | 618 |
| 620 current_screen_ = new_screen; | 619 current_screen_ = new_screen; |
| 621 for (Observer& observer : observer_list_) | 620 for (Observer& observer : observer_list_) |
| 622 observer.OnCurrentScreenChanged(current_screen_, new_screen); | 621 observer.OnCurrentScreenChanged(current_screen_, new_screen); |
| 623 } | 622 } |
| 624 | 623 |
| 624 void OobeUI::UpdateLocalizedStringsIfNeeded() { |
| 625 if (oobe_ui_md_mode_ == |
| 626 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode)) { |
| 627 return; |
| 628 } |
| 629 |
| 630 base::DictionaryValue localized_strings; |
| 631 GetLocalizedStrings(&localized_strings); |
| 632 static_cast<CoreOobeActor*>(core_handler_)->ReloadContent(localized_strings); |
| 633 } |
| 634 |
| 625 } // namespace chromeos | 635 } // namespace chromeos |
| OLD | NEW |