Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/oobe_ui.h

Issue 811033002: Add device policy to disallow shutdown - ash UI modifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shutdown_allowed => reboot_on_shutdown Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/ui/webui/chromeos/login/core_oobe_handler.h" 17 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h"
18 #include "chrome/browser/ui/webui/chromeos/login/shutdown_policy_observer.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;
27 class ControllerPairingScreenActor; 28 class ControllerPairingScreenActor;
(...skipping 11 matching lines...) Expand all
39 class SigninScreenHandler; 40 class SigninScreenHandler;
40 class SigninScreenHandlerDelegate; 41 class SigninScreenHandlerDelegate;
41 class UpdateScreenHandler; 42 class UpdateScreenHandler;
42 43
43 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI: 44 // A custom WebUI that defines datasource for out-of-box-experience (OOBE) UI:
44 // - welcome screen (setup language/keyboard/network). 45 // - welcome screen (setup language/keyboard/network).
45 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting). 46 // - eula screen (CrOS (+ OEM) EULA content/TPM password/crash reporting).
46 // - update screen. 47 // - update screen.
47 class OobeUI : public OobeDisplay, 48 class OobeUI : public OobeDisplay,
48 public content::WebUIController, 49 public content::WebUIController,
49 public CoreOobeHandler::Delegate { 50 public CoreOobeHandler::Delegate,
51 public ShutdownPolicyObserver::Delegate {
50 public: 52 public:
51 class Observer { 53 class Observer {
52 public: 54 public:
53 virtual ~Observer() {} 55 virtual ~Observer() {}
54 virtual void OnCurrentScreenChanged( 56 virtual void OnCurrentScreenChanged(
55 Screen current_screen, Screen new_screen) = 0; 57 Screen current_screen, Screen new_screen) = 0;
56 }; 58 };
57 59
58 // List of known types of OobeUI. Type added as path in chrome://oobe url, for 60 // List of known types of OobeUI. Type added as path in chrome://oobe url, for
59 // example chrome://oobe/user-adding. 61 // example chrome://oobe/user-adding.
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 GetAppLaunchSplashScreenActor() override; 120 GetAppLaunchSplashScreenActor() override;
119 virtual bool IsJSReady(const base::Closure& display_is_ready_callback) 121 virtual bool IsJSReady(const base::Closure& display_is_ready_callback)
120 override; 122 override;
121 virtual HIDDetectionScreenActor* GetHIDDetectionScreenActor() override; 123 virtual HIDDetectionScreenActor* GetHIDDetectionScreenActor() override;
122 virtual ControllerPairingScreenActor* GetControllerPairingScreenActor() 124 virtual ControllerPairingScreenActor* GetControllerPairingScreenActor()
123 override; 125 override;
124 virtual HostPairingScreenActor* GetHostPairingScreenActor() override; 126 virtual HostPairingScreenActor* GetHostPairingScreenActor() override;
125 DeviceDisabledScreenActor* GetDeviceDisabledScreenActor() override; 127 DeviceDisabledScreenActor* GetDeviceDisabledScreenActor() override;
126 virtual GaiaScreenHandler* GetGaiaScreenActor() override; 128 virtual GaiaScreenHandler* GetGaiaScreenActor() override;
127 129
130 // Override from ShutdownPolicyObserver::Delegate.
131 virtual void OnShutdownPolicyChanged(bool reboot_on_shutdown) override;
132
133 // Initializes ShutdownPolicyObserver and triggers an initial update.
134 void InitShutdownPolicyObserver();
135
128 // Collects localized strings from the owned handlers. 136 // Collects localized strings from the owned handlers.
129 void GetLocalizedStrings(base::DictionaryValue* localized_strings); 137 void GetLocalizedStrings(base::DictionaryValue* localized_strings);
130 138
131 // Initializes the handlers. 139 // Initializes the handlers.
132 void InitializeHandlers(); 140 void InitializeHandlers();
133 141
134 // Invoked after the async assets load. The screen handler that has the same 142 // Invoked after the async assets load. The screen handler that has the same
135 // async assets load id will be initialized. 143 // async assets load id will be initialized.
136 void OnScreenAssetsLoaded(const std::string& async_assets_load_id); 144 void OnScreenAssetsLoaded(const std::string& async_assets_load_id);
137 145
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // Flag that indicates whether JS part is fully loaded and ready to accept 253 // Flag that indicates whether JS part is fully loaded and ready to accept
246 // calls. 254 // calls.
247 bool ready_; 255 bool ready_;
248 256
249 // Callbacks to notify when JS part is fully loaded and ready to accept calls. 257 // Callbacks to notify when JS part is fully loaded and ready to accept calls.
250 std::vector<base::Closure> ready_callbacks_; 258 std::vector<base::Closure> ready_callbacks_;
251 259
252 // List of registered observers. 260 // List of registered observers.
253 ObserverList<Observer> observer_list_; 261 ObserverList<Observer> observer_list_;
254 262
263 // Observer of CrosSettings watching the kShutdownAllowed policy.
264 scoped_ptr<ShutdownPolicyObserver> shutdown_policy_observer_;
265
255 DISALLOW_COPY_AND_ASSIGN(OobeUI); 266 DISALLOW_COPY_AND_ASSIGN(OobeUI);
256 }; 267 };
257 268
258 } // namespace chromeos 269 } // namespace chromeos
259 270
260 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_ 271 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_OOBE_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698