| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 class UserBoardView; | 60 class UserBoardView; |
| 61 class UserImageView; | 61 class UserImageView; |
| 62 class UpdateView; | 62 class UpdateView; |
| 63 class WrongHWIDScreenView; | 63 class WrongHWIDScreenView; |
| 64 | 64 |
| 65 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI: | 65 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI: |
| 66 // - welcome screen (setup language/keyboard/network). | 66 // - welcome screen (setup language/keyboard/network). |
| 67 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting). | 67 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting). |
| 68 // - update screen. | 68 // - update screen. |
| 69 class OobeUI : public content::WebUIController, | 69 class OobeUI : public content::WebUIController, |
| 70 public CoreOobeHandler::Delegate, | |
| 71 public ShutdownPolicyHandler::Delegate { | 70 public ShutdownPolicyHandler::Delegate { |
| 72 public: | 71 public: |
| 73 // List of known types of OobeUI. Type added as path in chrome://oobe url, for | 72 // List of known types of OobeUI. Type added as path in chrome://oobe url, for |
| 74 // example chrome://oobe/user-adding. | 73 // example chrome://oobe/user-adding. |
| 75 static const char kOobeDisplay[]; | 74 static const char kOobeDisplay[]; |
| 76 static const char kLoginDisplay[]; | 75 static const char kLoginDisplay[]; |
| 77 static const char kLockDisplay[]; | 76 static const char kLockDisplay[]; |
| 78 static const char kUserAddingDisplay[]; | 77 static const char kUserAddingDisplay[]; |
| 79 static const char kAppLaunchSplashDisplay[]; | 78 static const char kAppLaunchSplashDisplay[]; |
| 80 static const char kArcKioskSplashDisplay[]; | 79 static const char kArcKioskSplashDisplay[]; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 119 |
| 121 // ShutdownPolicyHandler::Delegate | 120 // ShutdownPolicyHandler::Delegate |
| 122 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override; | 121 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override; |
| 123 | 122 |
| 124 // Collects localized strings from the owned handlers. | 123 // Collects localized strings from the owned handlers. |
| 125 void GetLocalizedStrings(base::DictionaryValue* localized_strings); | 124 void GetLocalizedStrings(base::DictionaryValue* localized_strings); |
| 126 | 125 |
| 127 // Initializes the handlers. | 126 // Initializes the handlers. |
| 128 void InitializeHandlers(); | 127 void InitializeHandlers(); |
| 129 | 128 |
| 129 // Called when the screen has changed. |
| 130 void CurrentScreenChanged(OobeScreen screen); |
| 131 |
| 130 // Invoked after the async assets load. The screen handler that has the same | 132 // Invoked after the async assets load. The screen handler that has the same |
| 131 // async assets load id will be initialized. | 133 // async assets load id will be initialized. |
| 132 void OnScreenAssetsLoaded(const std::string& async_assets_load_id); | 134 void OnScreenAssetsLoaded(const std::string& async_assets_load_id); |
| 133 | 135 |
| 134 bool IsJSReady(const base::Closure& display_is_ready_callback); | 136 bool IsJSReady(const base::Closure& display_is_ready_callback); |
| 135 | 137 |
| 136 // Shows or hides OOBE UI elements. | 138 // Shows or hides OOBE UI elements. |
| 137 void ShowOobeUI(bool show); | 139 void ShowOobeUI(bool show); |
| 138 | 140 |
| 139 // Shows the signin screen. | 141 // Shows the signin screen. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 179 } |
| 178 | 180 |
| 179 NOTREACHED() << "Unable to find handler for screen " | 181 NOTREACHED() << "Unable to find handler for screen " |
| 180 << GetOobeScreenName(expected_screen); | 182 << GetOobeScreenName(expected_screen); |
| 181 return nullptr; | 183 return nullptr; |
| 182 } | 184 } |
| 183 | 185 |
| 184 void AddWebUIHandler(std::unique_ptr<BaseWebUIHandler> handler); | 186 void AddWebUIHandler(std::unique_ptr<BaseWebUIHandler> handler); |
| 185 void AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler); | 187 void AddScreenHandler(std::unique_ptr<BaseScreenHandler> handler); |
| 186 | 188 |
| 187 // CoreOobeHandler::Delegate implementation: | |
| 188 void OnCurrentScreenChanged(OobeScreen screen) override; | |
| 189 | |
| 190 // Type of UI. | 189 // Type of UI. |
| 191 std::string display_type_; | 190 std::string display_type_; |
| 192 | 191 |
| 193 // Reference to NetworkStateInformer that handles changes in network | 192 // Reference to NetworkStateInformer that handles changes in network |
| 194 // state. | 193 // state. |
| 195 scoped_refptr<NetworkStateInformer> network_state_informer_; | 194 scoped_refptr<NetworkStateInformer> network_state_informer_; |
| 196 | 195 |
| 197 // Reference to CoreOobeHandler that handles common requests of Oobe page. | 196 // Reference to CoreOobeHandler that handles common requests of Oobe page. |
| 198 CoreOobeHandler* core_handler_ = nullptr; | 197 CoreOobeHandler* core_handler_ = nullptr; |
| 199 | 198 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // Store the deferred JS calls before the screen handler instance is | 242 // Store the deferred JS calls before the screen handler instance is |
| 244 // initialized. | 243 // initialized. |
| 245 std::unique_ptr<JSCallsContainer> js_calls_container; | 244 std::unique_ptr<JSCallsContainer> js_calls_container; |
| 246 | 245 |
| 247 DISALLOW_COPY_AND_ASSIGN(OobeUI); | 246 DISALLOW_COPY_AND_ASSIGN(OobeUI); |
| 248 }; | 247 }; |
| 249 | 248 |
| 250 } // namespace chromeos | 249 } // namespace chromeos |
| 251 | 250 |
| 252 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ | 251 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ |
| OLD | NEW |