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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 localized_strings->SetString("highlightStrength", | 523 localized_strings->SetString("highlightStrength", |
524 keyboard_driven_oobe ? "strong" : "normal"); | 524 keyboard_driven_oobe ? "strong" : "normal"); |
525 | 525 |
526 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 526 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
527 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); | 527 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); |
528 oobe_ui_md_mode_ = | 528 oobe_ui_md_mode_ = |
529 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode); | 529 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode); |
530 localized_strings->SetString("newOobeUI", oobe_ui_md_mode_ ? "on" : "off"); | 530 localized_strings->SetString("newOobeUI", oobe_ui_md_mode_ ? "on" : "off"); |
531 } | 531 } |
532 | 532 |
| 533 void OobeUI::ExecuteDeferredJSCalls() { |
| 534 DCHECK(!is_initialized_); |
| 535 is_initialized_ = true; |
| 536 for (const auto& deferred_js_call : deferred_js_calls_) |
| 537 deferred_js_call.Run(); |
| 538 deferred_js_calls_.clear(); |
| 539 } |
| 540 |
533 void OobeUI::AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler) { | 541 void OobeUI::AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler) { |
534 handlers_.push_back(handler.get()); | 542 handlers_.push_back(handler.get()); |
535 web_ui()->AddMessageHandler(std::move(handler)); | 543 web_ui()->AddMessageHandler(std::move(handler)); |
536 } | 544 } |
537 | 545 |
538 void OobeUI::InitializeHandlers() { | 546 void OobeUI::InitializeHandlers() { |
539 ready_ = true; | 547 ready_ = true; |
540 for (size_t i = 0; i < ready_callbacks_.size(); ++i) | 548 for (size_t i = 0; i < ready_callbacks_.size(); ++i) |
541 ready_callbacks_[i].Run(); | 549 ready_callbacks_[i].Run(); |
542 ready_callbacks_.clear(); | 550 ready_callbacks_.clear(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode)) { | 647 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode)) { |
640 return; | 648 return; |
641 } | 649 } |
642 | 650 |
643 base::DictionaryValue localized_strings; | 651 base::DictionaryValue localized_strings; |
644 GetLocalizedStrings(&localized_strings); | 652 GetLocalizedStrings(&localized_strings); |
645 static_cast<CoreOobeActor*>(core_handler_)->ReloadContent(localized_strings); | 653 static_cast<CoreOobeActor*>(core_handler_)->ReloadContent(localized_strings); |
646 } | 654 } |
647 | 655 |
648 } // namespace chromeos | 656 } // namespace chromeos |
OLD | NEW |