| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SIGNIN_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.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/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "chrome/browser/chromeos/login/help_app_launcher.h" | 16 #include "chrome/browser/chromeos/login/help_app_launcher.h" |
| 17 #include "chrome/browser/chromeos/login/login_display.h" | 17 #include "chrome/browser/chromeos/login/login_display.h" |
| 18 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 18 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
| 19 #include "chrome/browser/chromeos/login/user_manager.h" | 19 #include "chrome/browser/chromeos/login/user_manager.h" |
| 20 #include "chrome/browser/chromeos/login/wallpaper_manager.h" | |
| 21 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 20 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 22 #include "chrome/browser/chromeos/settings/cros_settings.h" | 21 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 23 #include "chrome/browser/chromeos/system_key_event_listener.h" | 22 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 24 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 23 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 25 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 24 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 27 #include "content/public/browser/notification_observer.h" | 26 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 27 #include "content/public/browser/notification_registrar.h" |
| 29 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
| 30 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 virtual ~SigninScreenHandlerDelegate() {} | 166 virtual ~SigninScreenHandlerDelegate() {} |
| 168 }; | 167 }; |
| 169 | 168 |
| 170 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay | 169 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay |
| 171 // and LoginDisplay. | 170 // and LoginDisplay. |
| 172 class SigninScreenHandler | 171 class SigninScreenHandler |
| 173 : public BaseScreenHandler, | 172 : public BaseScreenHandler, |
| 174 public LoginDisplayWebUIHandler, | 173 public LoginDisplayWebUIHandler, |
| 175 public SystemKeyEventListener::CapsLockObserver, | 174 public SystemKeyEventListener::CapsLockObserver, |
| 176 public content::NotificationObserver, | 175 public content::NotificationObserver, |
| 177 public NetworkStateInformer::NetworkStateInformerObserver, | 176 public NetworkStateInformer::NetworkStateInformerObserver { |
| 178 public WallpaperManager::Observer { | |
| 179 public: | 177 public: |
| 180 SigninScreenHandler( | 178 SigninScreenHandler( |
| 181 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 179 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 182 ErrorScreenActor* error_screen_actor, | 180 ErrorScreenActor* error_screen_actor, |
| 183 CoreOobeActor* core_oobe_actor); | 181 CoreOobeActor* core_oobe_actor); |
| 184 virtual ~SigninScreenHandler(); | 182 virtual ~SigninScreenHandler(); |
| 185 | 183 |
| 186 // Shows the sign in screen. |oobe_ui| indicates whether the signin | 184 // Shows the sign in screen. |oobe_ui| indicates whether the signin |
| 187 // screen is for OOBE or usual sign-in flow. | 185 // screen is for OOBE or usual sign-in flow. |
| 188 void Show(bool oobe_ui); | 186 void Show(bool oobe_ui); |
| 189 | 187 |
| 190 // Shows the login spinner UI for retail mode logins. | 188 // Shows the login spinner UI for retail mode logins. |
| 191 void ShowRetailModeLoginSpinner(); | 189 void ShowRetailModeLoginSpinner(); |
| 192 | 190 |
| 193 // Sets delegate to be used by the handler. It is guaranteed that valid | 191 // Sets delegate to be used by the handler. It is guaranteed that valid |
| 194 // delegate is set before Show() method will be called. | 192 // delegate is set before Show() method will be called. |
| 195 void SetDelegate(SigninScreenHandlerDelegate* delegate); | 193 void SetDelegate(SigninScreenHandlerDelegate* delegate); |
| 196 | 194 |
| 197 void SetNativeWindowDelegate(NativeWindowDelegate* native_window_delegate); | 195 void SetNativeWindowDelegate(NativeWindowDelegate* native_window_delegate); |
| 198 | 196 |
| 199 // NetworkStateInformer::NetworkStateInformerObserver implementation: | 197 // NetworkStateInformer::NetworkStateInformerObserver implementation: |
| 200 virtual void OnNetworkReady() OVERRIDE; | 198 virtual void OnNetworkReady() OVERRIDE; |
| 201 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; | 199 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; |
| 202 | 200 |
| 203 // Required Local State preferences. | 201 // Required Local State preferences. |
| 204 static void RegisterPrefs(PrefRegistrySimple* registry); | 202 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 205 | 203 |
| 206 // From WallpaperManager::Observer | |
| 207 virtual void OnWallpaperAnimationFinished(const std::string& email) OVERRIDE; | |
| 208 | |
| 209 void set_kiosk_enable_flow_aborted_callback_for_test( | 204 void set_kiosk_enable_flow_aborted_callback_for_test( |
| 210 const base::Closure& callback) { | 205 const base::Closure& callback) { |
| 211 kiosk_enable_flow_aborted_callback_for_test_ = callback; | 206 kiosk_enable_flow_aborted_callback_for_test_ = callback; |
| 212 } | 207 } |
| 213 | 208 |
| 214 private: | 209 private: |
| 215 enum UIState { | 210 enum UIState { |
| 216 UI_STATE_UNKNOWN = 0, | 211 UI_STATE_UNKNOWN = 0, |
| 217 UI_STATE_GAIA_SIGNIN, | 212 UI_STATE_GAIA_SIGNIN, |
| 218 UI_STATE_ACCOUNT_PICKER, | 213 UI_STATE_ACCOUNT_PICKER, |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 bool wait_for_auto_enrollment_check_; | 487 bool wait_for_auto_enrollment_check_; |
| 493 | 488 |
| 494 base::Closure kiosk_enable_flow_aborted_callback_for_test_; | 489 base::Closure kiosk_enable_flow_aborted_callback_for_test_; |
| 495 | 490 |
| 496 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 491 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 497 }; | 492 }; |
| 498 | 493 |
| 499 } // namespace chromeos | 494 } // namespace chromeos |
| 500 | 495 |
| 501 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 496 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |