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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
16 #include "chrome/browser/chromeos/login/ui/oobe_display.h" | 16 #include "chrome/browser/chromeos/login/ui/oobe_display.h" |
| 17 #include "chrome/browser/chromeos/settings/shutdown_policy_handler.h" |
17 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" | 18 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" |
18 #include "content/public/browser/web_ui_controller.h" | 19 #include "content/public/browser/web_ui_controller.h" |
19 | 20 |
20 namespace base { | 21 namespace base { |
21 class DictionaryValue; | 22 class DictionaryValue; |
22 } // namespace base | 23 } // namespace base |
23 | 24 |
24 namespace chromeos { | 25 namespace chromeos { |
25 class AppLaunchSplashScreenActor; | 26 class AppLaunchSplashScreenActor; |
26 class BaseScreenHandler; | 27 class BaseScreenHandler; |
(...skipping 13 matching lines...) Expand all Loading... |
40 class SigninScreenHandlerDelegate; | 41 class SigninScreenHandlerDelegate; |
41 class UpdateScreenHandler; | 42 class UpdateScreenHandler; |
42 class UserBoardScreenHandler; | 43 class UserBoardScreenHandler; |
43 | 44 |
44 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI: | 45 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI: |
45 // - welcome screen (setup language/keyboard/network). | 46 // - welcome screen (setup language/keyboard/network). |
46 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting). | 47 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting). |
47 // - update screen. | 48 // - update screen. |
48 class OobeUI : public OobeDisplay, | 49 class OobeUI : public OobeDisplay, |
49 public content::WebUIController, | 50 public content::WebUIController, |
50 public CoreOobeHandler::Delegate { | 51 public CoreOobeHandler::Delegate, |
| 52 public ShutdownPolicyHandler::Delegate { |
51 public: | 53 public: |
52 class Observer { | 54 class Observer { |
53 public: | 55 public: |
54 virtual ~Observer() {} | 56 virtual ~Observer() {} |
55 virtual void OnCurrentScreenChanged( | 57 virtual void OnCurrentScreenChanged( |
56 Screen current_screen, Screen new_screen) = 0; | 58 Screen current_screen, Screen new_screen) = 0; |
57 }; | 59 }; |
58 | 60 |
59 // List of known types of OobeUI. Type added as path in chrome://oobe url, for | 61 // List of known types of OobeUI. Type added as path in chrome://oobe url, for |
60 // example chrome://oobe/user-adding. | 62 // example chrome://oobe/user-adding. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 override; | 117 override; |
116 AppLaunchSplashScreenActor* GetAppLaunchSplashScreenActor() override; | 118 AppLaunchSplashScreenActor* GetAppLaunchSplashScreenActor() override; |
117 bool IsJSReady(const base::Closure& display_is_ready_callback) override; | 119 bool IsJSReady(const base::Closure& display_is_ready_callback) override; |
118 HIDDetectionScreenActor* GetHIDDetectionScreenActor() override; | 120 HIDDetectionScreenActor* GetHIDDetectionScreenActor() override; |
119 ControllerPairingScreenActor* GetControllerPairingScreenActor() override; | 121 ControllerPairingScreenActor* GetControllerPairingScreenActor() override; |
120 HostPairingScreenActor* GetHostPairingScreenActor() override; | 122 HostPairingScreenActor* GetHostPairingScreenActor() override; |
121 DeviceDisabledScreenActor* GetDeviceDisabledScreenActor() override; | 123 DeviceDisabledScreenActor* GetDeviceDisabledScreenActor() override; |
122 GaiaScreenHandler* GetGaiaScreenActor() override; | 124 GaiaScreenHandler* GetGaiaScreenActor() override; |
123 UserBoardView* GetUserBoardScreenActor() override; | 125 UserBoardView* GetUserBoardScreenActor() override; |
124 | 126 |
| 127 // ShutdownPolicyObserver::Delegate |
| 128 void OnShutdownPolicyChanged(bool reboot_on_shutdown) override; |
| 129 |
125 // Collects localized strings from the owned handlers. | 130 // Collects localized strings from the owned handlers. |
126 void GetLocalizedStrings(base::DictionaryValue* localized_strings); | 131 void GetLocalizedStrings(base::DictionaryValue* localized_strings); |
127 | 132 |
128 // Initializes the handlers. | 133 // Initializes the handlers. |
129 void InitializeHandlers(); | 134 void InitializeHandlers(); |
130 | 135 |
131 // Invoked after the async assets load. The screen handler that has the same | 136 // Invoked after the async assets load. The screen handler that has the same |
132 // async assets load id will be initialized. | 137 // async assets load id will be initialized. |
133 void OnScreenAssetsLoaded(const std::string& async_assets_load_id); | 138 void OnScreenAssetsLoaded(const std::string& async_assets_load_id); |
134 | 139 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // Flag that indicates whether JS part is fully loaded and ready to accept | 246 // Flag that indicates whether JS part is fully loaded and ready to accept |
242 // calls. | 247 // calls. |
243 bool ready_; | 248 bool ready_; |
244 | 249 |
245 // Callbacks to notify when JS part is fully loaded and ready to accept calls. | 250 // Callbacks to notify when JS part is fully loaded and ready to accept calls. |
246 std::vector<base::Closure> ready_callbacks_; | 251 std::vector<base::Closure> ready_callbacks_; |
247 | 252 |
248 // List of registered observers. | 253 // List of registered observers. |
249 ObserverList<Observer> observer_list_; | 254 ObserverList<Observer> observer_list_; |
250 | 255 |
| 256 // Observer of CrosSettings watching the kRebootOnShutdown policy. |
| 257 scoped_ptr<ShutdownPolicyHandler> shutdown_policy_handler_; |
| 258 |
251 DISALLOW_COPY_AND_ASSIGN(OobeUI); | 259 DISALLOW_COPY_AND_ASSIGN(OobeUI); |
252 }; | 260 }; |
253 | 261 |
254 } // namespace chromeos | 262 } // namespace chromeos |
255 | 263 |
256 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ | 264 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ |
OLD | NEW |