| 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" |
| 20 #include "chrome/browser/chromeos/net/network_portal_detector.h" | 21 #include "chrome/browser/chromeos/net/network_portal_detector.h" |
| 21 #include "chrome/browser/chromeos/settings/cros_settings.h" | 22 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 22 #include "chrome/browser/chromeos/system_key_event_listener.h" | 23 #include "chrome/browser/chromeos/system_key_event_listener.h" |
| 23 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 24 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 24 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 26 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
| 27 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
| 28 #include "content/public/browser/web_ui.h" | 29 #include "content/public/browser/web_ui.h" |
| 29 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 virtual ~SigninScreenHandlerDelegate() {} | 167 virtual ~SigninScreenHandlerDelegate() {} |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay | 170 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay |
| 170 // and LoginDisplay. | 171 // and LoginDisplay. |
| 171 class SigninScreenHandler | 172 class SigninScreenHandler |
| 172 : public BaseScreenHandler, | 173 : public BaseScreenHandler, |
| 173 public LoginDisplayWebUIHandler, | 174 public LoginDisplayWebUIHandler, |
| 174 public SystemKeyEventListener::CapsLockObserver, | 175 public SystemKeyEventListener::CapsLockObserver, |
| 175 public content::NotificationObserver, | 176 public content::NotificationObserver, |
| 176 public NetworkStateInformer::NetworkStateInformerObserver { | 177 public NetworkStateInformer::NetworkStateInformerObserver, |
| 178 public WallpaperManager::Observer { |
| 177 public: | 179 public: |
| 178 SigninScreenHandler( | 180 SigninScreenHandler( |
| 179 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 181 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 180 ErrorScreenActor* error_screen_actor, | 182 ErrorScreenActor* error_screen_actor, |
| 181 CoreOobeActor* core_oobe_actor); | 183 CoreOobeActor* core_oobe_actor); |
| 182 virtual ~SigninScreenHandler(); | 184 virtual ~SigninScreenHandler(); |
| 183 | 185 |
| 184 // Shows the sign in screen. |oobe_ui| indicates whether the signin | 186 // Shows the sign in screen. |oobe_ui| indicates whether the signin |
| 185 // screen is for OOBE or usual sign-in flow. | 187 // screen is for OOBE or usual sign-in flow. |
| 186 void Show(bool oobe_ui); | 188 void Show(bool oobe_ui); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 199 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; | 201 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; |
| 200 | 202 |
| 201 // Required Local State preferences. | 203 // Required Local State preferences. |
| 202 static void RegisterPrefs(PrefRegistrySimple* registry); | 204 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 203 | 205 |
| 204 void set_kiosk_enable_flow_aborted_callback_for_test( | 206 void set_kiosk_enable_flow_aborted_callback_for_test( |
| 205 const base::Closure& callback) { | 207 const base::Closure& callback) { |
| 206 kiosk_enable_flow_aborted_callback_for_test_ = callback; | 208 kiosk_enable_flow_aborted_callback_for_test_ = callback; |
| 207 } | 209 } |
| 208 | 210 |
| 211 // From WallpaperManager::Observer |
| 212 virtual void OnWallpaperAnimationFinished(const std::string& email) OVERRIDE; |
| 213 |
| 209 private: | 214 private: |
| 210 enum UIState { | 215 enum UIState { |
| 211 UI_STATE_UNKNOWN = 0, | 216 UI_STATE_UNKNOWN = 0, |
| 212 UI_STATE_GAIA_SIGNIN, | 217 UI_STATE_GAIA_SIGNIN, |
| 213 UI_STATE_ACCOUNT_PICKER, | 218 UI_STATE_ACCOUNT_PICKER, |
| 214 }; | 219 }; |
| 215 | 220 |
| 216 enum FrameState { | 221 enum FrameState { |
| 217 FRAME_STATE_UNKNOWN = 0, | 222 FRAME_STATE_UNKNOWN = 0, |
| 218 FRAME_STATE_LOADING, | 223 FRAME_STATE_LOADING, |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 bool wait_for_auto_enrollment_check_; | 492 bool wait_for_auto_enrollment_check_; |
| 488 | 493 |
| 489 base::Closure kiosk_enable_flow_aborted_callback_for_test_; | 494 base::Closure kiosk_enable_flow_aborted_callback_for_test_; |
| 490 | 495 |
| 491 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 496 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 492 }; | 497 }; |
| 493 | 498 |
| 494 } // namespace chromeos | 499 } // namespace chromeos |
| 495 | 500 |
| 496 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 501 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |