| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" | 50 #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" |
| 51 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 51 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 52 #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h" |
| 53 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 53 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 54 #include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen
_handler.h" | 54 #include "chrome/browser/ui/webui/chromeos/login/supervised_user_creation_screen
_handler.h" |
| 55 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler
.h" | 55 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler
.h" |
| 56 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" | 56 #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" |
| 57 #include "chrome/browser/ui/webui/chromeos/login/user_board_screen_handler.h" | 57 #include "chrome/browser/ui/webui/chromeos/login/user_board_screen_handler.h" |
| 58 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" | 58 #include "chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h" |
| 59 #include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" | 59 #include "chrome/browser/ui/webui/chromeos/login/wrong_hwid_screen_handler.h" |
| 60 #include "chrome/browser/ui/webui/chromeos/network_ui.h" |
| 60 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h" | 61 #include "chrome/browser/ui/webui/options/chromeos/user_image_source.h" |
| 61 #include "chrome/browser/ui/webui/test_files_request_filter.h" | 62 #include "chrome/browser/ui/webui/test_files_request_filter.h" |
| 62 #include "chrome/browser/ui/webui/theme_source.h" | 63 #include "chrome/browser/ui/webui/theme_source.h" |
| 63 #include "chrome/common/chrome_constants.h" | 64 #include "chrome/common/chrome_constants.h" |
| 64 #include "chrome/common/chrome_switches.h" | 65 #include "chrome/common/chrome_switches.h" |
| 65 #include "chrome/common/url_constants.h" | 66 #include "chrome/common/url_constants.h" |
| 66 #include "chromeos/chromeos_switches.h" | 67 #include "chromeos/chromeos_switches.h" |
| 67 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 68 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
| 68 #include "content/public/browser/web_ui.h" | 69 #include "content/public/browser/web_ui.h" |
| 69 #include "content/public/browser/web_ui_data_source.h" | 70 #include "content/public/browser/web_ui_data_source.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 std::string path = url.path().size() ? url.path().substr(1) : ""; | 174 std::string path = url.path().size() ? url.path().substr(1) : ""; |
| 174 if (std::find(kKnownDisplayTypes, | 175 if (std::find(kKnownDisplayTypes, |
| 175 kKnownDisplayTypes + arraysize(kKnownDisplayTypes), | 176 kKnownDisplayTypes + arraysize(kKnownDisplayTypes), |
| 176 path) == kKnownDisplayTypes + arraysize(kKnownDisplayTypes)) { | 177 path) == kKnownDisplayTypes + arraysize(kKnownDisplayTypes)) { |
| 177 LOG(ERROR) << "Unknown display type '" << path << "'. Setting default."; | 178 LOG(ERROR) << "Unknown display type '" << path << "'. Setting default."; |
| 178 return OobeUI::kLoginDisplay; | 179 return OobeUI::kLoginDisplay; |
| 179 } | 180 } |
| 180 return path; | 181 return path; |
| 181 } | 182 } |
| 182 | 183 |
| 184 bool UseMDOobe() { |
| 185 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 186 chromeos::switches::kEnableMdOobe); |
| 187 } |
| 188 |
| 183 } // namespace | 189 } // namespace |
| 184 | 190 |
| 185 // static | 191 // static |
| 186 const char OobeUI::kOobeDisplay[] = "oobe"; | 192 const char OobeUI::kOobeDisplay[] = "oobe"; |
| 187 const char OobeUI::kLoginDisplay[] = "login"; | 193 const char OobeUI::kLoginDisplay[] = "login"; |
| 188 const char OobeUI::kLockDisplay[] = "lock"; | 194 const char OobeUI::kLockDisplay[] = "lock"; |
| 189 const char OobeUI::kUserAddingDisplay[] = "user-adding"; | 195 const char OobeUI::kUserAddingDisplay[] = "user-adding"; |
| 190 const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash"; | 196 const char OobeUI::kAppLaunchSplashDisplay[] = "app-launch-splash"; |
| 191 | 197 |
| 192 OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url) | 198 OobeUI::OobeUI(content::WebUI* web_ui, const GURL& url) |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 localized_strings->SetString("bootIntoWallpaper", "off"); | 484 localized_strings->SetString("bootIntoWallpaper", "off"); |
| 479 } | 485 } |
| 480 | 486 |
| 481 bool keyboard_driven_oobe = | 487 bool keyboard_driven_oobe = |
| 482 system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); | 488 system::InputDeviceSettings::Get()->ForceKeyboardDrivenUINavigation(); |
| 483 localized_strings->SetString("highlightStrength", | 489 localized_strings->SetString("highlightStrength", |
| 484 keyboard_driven_oobe ? "strong" : "normal"); | 490 keyboard_driven_oobe ? "strong" : "normal"); |
| 485 | 491 |
| 486 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 492 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
| 487 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); | 493 localized_strings->SetString("newKioskUI", new_kiosk_ui ? "on" : "off"); |
| 494 |
| 495 localized_strings->SetString("newOobeUI", UseMDOobe() ? "on" : "off"); |
| 488 } | 496 } |
| 489 | 497 |
| 490 void OobeUI::AddScreenHandler(BaseScreenHandler* handler) { | 498 void OobeUI::AddScreenHandler(BaseScreenHandler* handler) { |
| 491 web_ui()->AddMessageHandler(handler); | 499 web_ui()->AddMessageHandler(handler); |
| 492 handlers_.push_back(handler); | 500 handlers_.push_back(handler); |
| 493 } | 501 } |
| 494 | 502 |
| 495 void OobeUI::InitializeHandlers() { | 503 void OobeUI::InitializeHandlers() { |
| 496 ready_ = true; | 504 ready_ = true; |
| 497 for (size_t i = 0; i < ready_callbacks_.size(); ++i) | 505 for (size_t i = 0; i < ready_callbacks_.size(); ++i) |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 NOTIMPLEMENTED(); | 592 NOTIMPLEMENTED(); |
| 585 } | 593 } |
| 586 | 594 |
| 587 FOR_EACH_OBSERVER(Observer, | 595 FOR_EACH_OBSERVER(Observer, |
| 588 observer_list_, | 596 observer_list_, |
| 589 OnCurrentScreenChanged(current_screen_, new_screen)); | 597 OnCurrentScreenChanged(current_screen_, new_screen)); |
| 590 current_screen_ = new_screen; | 598 current_screen_ = new_screen; |
| 591 } | 599 } |
| 592 | 600 |
| 593 } // namespace chromeos | 601 } // namespace chromeos |
| OLD | NEW |