| 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 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/chromeos/login/wizard_controller.h" | 24 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 26 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h" | 26 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h" |
| 27 #include "chrome/browser/chromeos/system/input_device_settings.h" | 27 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 28 #include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h" | 28 #include "chrome/browser/extensions/signin/gaia_auth_extension_loader.h" |
| 29 #include "chrome/browser/extensions/tab_helper.h" | 29 #include "chrome/browser/extensions/tab_helper.h" |
| 30 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 31 #include "chrome/browser/ui/ash/ash_util.h" | 31 #include "chrome/browser/ui/ash/ash_util.h" |
| 32 #include "chrome/browser/ui/webui/about_ui.h" | 32 #include "chrome/browser/ui/webui/about_ui.h" |
| 33 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle
r.h" | 33 #include "chrome/browser/ui/webui/chromeos/login/app_launch_splash_screen_handle
r.h" |
| 34 #include "chrome/browser/ui/webui/chromeos/login/arc_kiosk_splash_screen_handler
.h" |
| 34 #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_han
dler.h" | 35 #include "chrome/browser/ui/webui/chromeos/login/arc_terms_of_service_screen_han
dler.h" |
| 35 #include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_ha
ndler.h" | 36 #include "chrome/browser/ui/webui/chromeos/login/auto_enrollment_check_screen_ha
ndler.h" |
| 36 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 37 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 37 #include "chrome/browser/ui/webui/chromeos/login/controller_pairing_screen_handl
er.h" | 38 #include "chrome/browser/ui/webui/chromeos/login/controller_pairing_screen_handl
er.h" |
| 38 #include "chrome/browser/ui/webui/chromeos/login/device_disabled_screen_handler.
h" | 39 #include "chrome/browser/ui/webui/chromeos/login/device_disabled_screen_handler.
h" |
| 39 #include "chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler
.h" | 40 #include "chrome/browser/ui/webui/chromeos/login/enable_debugging_screen_handler
.h" |
| 40 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" | 41 #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" |
| 41 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 42 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
| 42 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" | 43 #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" |
| 43 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 44 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 74 #include "content/public/browser/web_ui.h" | 75 #include "content/public/browser/web_ui.h" |
| 75 #include "content/public/browser/web_ui_data_source.h" | 76 #include "content/public/browser/web_ui_data_source.h" |
| 76 #include "content/public/common/content_switches.h" | 77 #include "content/public/common/content_switches.h" |
| 77 #include "ui/base/resource/resource_bundle.h" | 78 #include "ui/base/resource/resource_bundle.h" |
| 78 #include "ui/base/webui/web_ui_util.h" | 79 #include "ui/base/webui/web_ui_util.h" |
| 79 | 80 |
| 80 namespace chromeos { | 81 namespace chromeos { |
| 81 | 82 |
| 82 namespace { | 83 namespace { |
| 83 | 84 |
| 84 const char* kKnownDisplayTypes[] = { | 85 const char* kKnownDisplayTypes[] = {OobeUI::kOobeDisplay, |
| 85 OobeUI::kOobeDisplay, | 86 OobeUI::kLoginDisplay, |
| 86 OobeUI::kLoginDisplay, | 87 OobeUI::kLockDisplay, |
| 87 OobeUI::kLockDisplay, | 88 OobeUI::kUserAddingDisplay, |
| 88 OobeUI::kUserAddingDisplay, | 89 OobeUI::kAppLaunchSplashDisplay, |
| 89 OobeUI::kAppLaunchSplashDisplay | 90 OobeUI::kArcKioskSplashDisplay}; |
| 90 }; | |
| 91 | 91 |
| 92 OobeScreen kDimOverlayScreenIds[] = { | 92 OobeScreen kDimOverlayScreenIds[] = { |
| 93 OobeScreen::SCREEN_CONFIRM_PASSWORD, | 93 OobeScreen::SCREEN_CONFIRM_PASSWORD, |
| 94 OobeScreen::SCREEN_GAIA_SIGNIN, | 94 OobeScreen::SCREEN_GAIA_SIGNIN, |
| 95 OobeScreen::SCREEN_OOBE_ENROLLMENT, | 95 OobeScreen::SCREEN_OOBE_ENROLLMENT, |
| 96 OobeScreen::SCREEN_PASSWORD_CHANGED, | 96 OobeScreen::SCREEN_PASSWORD_CHANGED, |
| 97 OobeScreen::SCREEN_USER_IMAGE_PICKER | 97 OobeScreen::SCREEN_USER_IMAGE_PICKER |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 const char kStringsJSPath[] = "strings.js"; | 100 const char kStringsJSPath[] = "strings.js"; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 } | 194 } |
| 195 | 195 |
| 196 } // namespace | 196 } // namespace |
| 197 | 197 |
| 198 // static | 198 // static |
| 199 const char OobeUI::kOobeDisplay[] = "oobe"; | 199 const char OobeUI::kOobeDisplay[] = "oobe"; |
| 200 const char OobeUI::kLoginDisplay[] = "login"; | 200 const char OobeUI::kLoginDisplay[] = "login"; |
| 201 const char OobeUI::kLockDisplay[] = "lock"; | 201 const char OobeUI::kLockDisplay[] = "lock"; |
| 202 const char OobeUI::kUserAddingDisplay[] = "user-adding"; | 202 const char OobeUI::kUserAddingDisplay[] = "user-adding"; |
| 203 const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash"; | 203 const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash"; |
| 204 const char OobeUI::kArcKioskSplashDisplay[] = "arc-kiosk-splash"; |
| 204 | 205 |
| 205 OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url) | 206 OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url) |
| 206 : WebUIController(web_ui) { | 207 : WebUIController(web_ui) { |
| 207 display_type_ = GetDisplayType(url); | 208 display_type_ = GetDisplayType(url); |
| 208 | 209 |
| 209 network_state_informer_ = new NetworkStateInformer(); | 210 network_state_informer_ = new NetworkStateInformer(); |
| 210 network_state_informer_->Init(); | 211 network_state_informer_->Init(); |
| 211 | 212 |
| 212 auto core_handler = base::MakeUnique<CoreOobeHandler>(this); | 213 auto core_handler = base::MakeUnique<CoreOobeHandler>(this); |
| 213 core_handler_ = core_handler.get(); | 214 core_handler_ = core_handler.get(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 gaia_screen_handler_); | 316 gaia_screen_handler_); |
| 316 signin_screen_handler_ = signin_screen_handler.get(); | 317 signin_screen_handler_ = signin_screen_handler.get(); |
| 317 AddScreenHandler(std::move(signin_screen_handler)); | 318 AddScreenHandler(std::move(signin_screen_handler)); |
| 318 | 319 |
| 319 auto app_launch_splash_screen_handler = | 320 auto app_launch_splash_screen_handler = |
| 320 base::MakeUnique<AppLaunchSplashScreenHandler>(network_state_informer_, | 321 base::MakeUnique<AppLaunchSplashScreenHandler>(network_state_informer_, |
| 321 network_error_model); | 322 network_error_model); |
| 322 app_launch_splash_screen_actor_ = app_launch_splash_screen_handler.get(); | 323 app_launch_splash_screen_actor_ = app_launch_splash_screen_handler.get(); |
| 323 AddScreenHandler(std::move(app_launch_splash_screen_handler)); | 324 AddScreenHandler(std::move(app_launch_splash_screen_handler)); |
| 324 | 325 |
| 326 auto arc_kiosk_splash_screen_handler = |
| 327 base::MakeUnique<ArcKioskSplashScreenHandler>(); |
| 328 arc_kiosk_splash_screen_actor_ = arc_kiosk_splash_screen_handler.get(); |
| 329 AddScreenHandler(std::move(arc_kiosk_splash_screen_handler)); |
| 330 |
| 325 if (display_type_ == kOobeDisplay) { | 331 if (display_type_ == kOobeDisplay) { |
| 326 auto controller_pairing_handler = | 332 auto controller_pairing_handler = |
| 327 base::MakeUnique<ControllerPairingScreenHandler>(); | 333 base::MakeUnique<ControllerPairingScreenHandler>(); |
| 328 controller_pairing_screen_actor_ = controller_pairing_handler.get(); | 334 controller_pairing_screen_actor_ = controller_pairing_handler.get(); |
| 329 AddScreenHandler(std::move(controller_pairing_handler)); | 335 AddScreenHandler(std::move(controller_pairing_handler)); |
| 330 | 336 |
| 331 auto host_pairing_handler = base::MakeUnique<HostPairingScreenHandler>(); | 337 auto host_pairing_handler = base::MakeUnique<HostPairingScreenHandler>(); |
| 332 host_pairing_screen_actor_ = host_pairing_handler.get(); | 338 host_pairing_screen_actor_ = host_pairing_handler.get(); |
| 333 AddScreenHandler(std::move(host_pairing_handler)); | 339 AddScreenHandler(std::move(host_pairing_handler)); |
| 334 } | 340 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 | 480 |
| 475 void OobeUI::OnShutdownPolicyChanged(bool reboot_on_shutdown) { | 481 void OobeUI::OnShutdownPolicyChanged(bool reboot_on_shutdown) { |
| 476 core_handler_->UpdateShutdownAndRebootVisibility(reboot_on_shutdown); | 482 core_handler_->UpdateShutdownAndRebootVisibility(reboot_on_shutdown); |
| 477 } | 483 } |
| 478 | 484 |
| 479 AppLaunchSplashScreenActor* | 485 AppLaunchSplashScreenActor* |
| 480 OobeUI::GetAppLaunchSplashScreenActor() { | 486 OobeUI::GetAppLaunchSplashScreenActor() { |
| 481 return app_launch_splash_screen_actor_; | 487 return app_launch_splash_screen_actor_; |
| 482 } | 488 } |
| 483 | 489 |
| 490 ArcKioskSplashScreenActor* OobeUI::GetArcKioskSplashScreenActor() { |
| 491 return arc_kiosk_splash_screen_actor_; |
| 492 } |
| 493 |
| 484 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { | 494 void OobeUI::GetLocalizedStrings(base::DictionaryValue* localized_strings) { |
| 485 // Note, handlers_[0] is a GenericHandler used by the WebUI. | 495 // Note, handlers_[0] is a GenericHandler used by the WebUI. |
| 486 for (size_t i = 0; i < handlers_.size(); ++i) { | 496 for (size_t i = 0; i < handlers_.size(); ++i) { |
| 487 handlers_[i]->GetLocalizedStrings(localized_strings); | 497 handlers_[i]->GetLocalizedStrings(localized_strings); |
| 488 } | 498 } |
| 489 const std::string& app_locale = g_browser_process->GetApplicationLocale(); | 499 const std::string& app_locale = g_browser_process->GetApplicationLocale(); |
| 490 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); | 500 webui::SetLoadTimeDataDefaults(app_locale, localized_strings); |
| 491 kiosk_app_menu_handler_->GetLocalizedStrings(localized_strings); | 501 kiosk_app_menu_handler_->GetLocalizedStrings(localized_strings); |
| 492 | 502 |
| 493 #if defined(GOOGLE_CHROME_BUILD) | 503 #if defined(GOOGLE_CHROME_BUILD) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode)) { | 636 g_browser_process->local_state()->GetBoolean(prefs::kOobeMdMode)) { |
| 627 return; | 637 return; |
| 628 } | 638 } |
| 629 | 639 |
| 630 base::DictionaryValue localized_strings; | 640 base::DictionaryValue localized_strings; |
| 631 GetLocalizedStrings(&localized_strings); | 641 GetLocalizedStrings(&localized_strings); |
| 632 static_cast<CoreOobeActor*>(core_handler_)->ReloadContent(localized_strings); | 642 static_cast<CoreOobeActor*>(core_handler_)->ReloadContent(localized_strings); |
| 633 } | 643 } |
| 634 | 644 |
| 635 } // namespace chromeos | 645 } // namespace chromeos |
| OLD | NEW |