| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/containers/hash_tables.h" | 15 #include "base/containers/hash_tables.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | 19 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" |
| 20 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" | 20 #include "chrome/browser/chromeos/login/screens/error_screen_actor.h" |
| 21 #include "chrome/browser/chromeos/login/signin_specifics.h" | 21 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 22 #include "chrome/browser/chromeos/login/ui/login_display.h" | 22 #include "chrome/browser/chromeos/login/ui/login_display.h" |
| 23 #include "chrome/browser/chromeos/settings/cros_settings.h" | 23 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 24 #include "chrome/browser/signin/screenlock_bridge.h" | 24 #include "chrome/browser/signin/signin_screen_bridge.h" |
| 25 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h" |
| 27 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
| 28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 28 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 29 #include "chrome/browser/ui/webui/chromeos/touch_view_controller_delegate.h" | 29 #include "chrome/browser/ui/webui/chromeos/touch_view_controller_delegate.h" |
| 30 #include "chromeos/ime/ime_keyboard.h" | 30 #include "chromeos/ime/ime_keyboard.h" |
| 31 #include "chromeos/network/portal_detector/network_portal_detector.h" | 31 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 32 #include "components/user_manager/user_manager.h" | 32 #include "components/user_manager/user_manager.h" |
| 33 #include "content/public/browser/notification_observer.h" | 33 #include "content/public/browser/notification_observer.h" |
| 34 #include "content/public/browser/notification_registrar.h" | 34 #include "content/public/browser/notification_registrar.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 187 |
| 188 // Whether user sign in has completed. | 188 // Whether user sign in has completed. |
| 189 virtual bool IsUserSigninCompleted() const = 0; | 189 virtual bool IsUserSigninCompleted() const = 0; |
| 190 | 190 |
| 191 // Request to (re)load user list. | 191 // Request to (re)load user list. |
| 192 virtual void HandleGetUsers() = 0; | 192 virtual void HandleGetUsers() = 0; |
| 193 | 193 |
| 194 // Set authentication type (for easier unlocking). | 194 // Set authentication type (for easier unlocking). |
| 195 virtual void SetAuthType( | 195 virtual void SetAuthType( |
| 196 const std::string& username, | 196 const std::string& username, |
| 197 ScreenlockBridge::LockHandler::AuthType auth_type) = 0; | 197 SigninScreenBridge::LockHandler::AuthType auth_type) = 0; |
| 198 | 198 |
| 199 // Get authentication type (for easier unlocking). | 199 // Get authentication type (for easier unlocking). |
| 200 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( | 200 virtual SigninScreenBridge::LockHandler::AuthType GetAuthType( |
| 201 const std::string& username) const = 0; | 201 const std::string& username) const = 0; |
| 202 | 202 |
| 203 protected: | 203 protected: |
| 204 virtual ~SigninScreenHandlerDelegate() {} | 204 virtual ~SigninScreenHandlerDelegate() {} |
| 205 }; | 205 }; |
| 206 | 206 |
| 207 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay | 207 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay |
| 208 // and LoginDisplay. | 208 // and LoginDisplay. |
| 209 class SigninScreenHandler | 209 class SigninScreenHandler |
| 210 : public BaseScreenHandler, | 210 : public BaseScreenHandler, |
| 211 public LoginDisplayWebUIHandler, | 211 public LoginDisplayWebUIHandler, |
| 212 public content::NotificationObserver, | 212 public content::NotificationObserver, |
| 213 public ScreenlockBridge::LockHandler, | 213 public SigninScreenBridge::LockHandler, |
| 214 public NetworkStateInformer::NetworkStateInformerObserver, | 214 public NetworkStateInformer::NetworkStateInformerObserver, |
| 215 public input_method::ImeKeyboard::Observer, | 215 public input_method::ImeKeyboard::Observer, |
| 216 public TouchViewControllerDelegate::Observer { | 216 public TouchViewControllerDelegate::Observer { |
| 217 public: | 217 public: |
| 218 SigninScreenHandler( | 218 SigninScreenHandler( |
| 219 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 219 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 220 ErrorScreenActor* error_screen_actor, | 220 ErrorScreenActor* error_screen_actor, |
| 221 CoreOobeActor* core_oobe_actor, | 221 CoreOobeActor* core_oobe_actor, |
| 222 GaiaScreenHandler* gaia_screen_handler); | 222 GaiaScreenHandler* gaia_screen_handler); |
| 223 virtual ~SigninScreenHandler(); | 223 virtual ~SigninScreenHandler(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 const std::string& user_id, | 306 const std::string& user_id, |
| 307 scoped_ptr<base::ListValue> locales, | 307 scoped_ptr<base::ListValue> locales, |
| 308 const std::string& default_locale, | 308 const std::string& default_locale, |
| 309 bool multipleRecommendedLocales) OVERRIDE; | 309 bool multipleRecommendedLocales) OVERRIDE; |
| 310 | 310 |
| 311 // content::NotificationObserver implementation: | 311 // content::NotificationObserver implementation: |
| 312 virtual void Observe(int type, | 312 virtual void Observe(int type, |
| 313 const content::NotificationSource& source, | 313 const content::NotificationSource& source, |
| 314 const content::NotificationDetails& details) OVERRIDE; | 314 const content::NotificationDetails& details) OVERRIDE; |
| 315 | 315 |
| 316 // ScreenlockBridge::LockHandler implementation: | 316 // SigninScreenBridge::LockHandler implementation: |
| 317 virtual void ShowBannerMessage(const base::string16& message) OVERRIDE; | 317 virtual void ShowBannerMessage(const base::string16& message) OVERRIDE; |
| 318 virtual void ShowUserPodCustomIcon( | 318 virtual void ShowUserPodCustomIcon( |
| 319 const std::string& username, | 319 const std::string& username, |
| 320 const ScreenlockBridge::UserPodCustomIconOptions& icon) OVERRIDE; | 320 const SigninScreenBridge::UserPodCustomIconOptions& icon) OVERRIDE; |
| 321 virtual void HideUserPodCustomIcon(const std::string& username) OVERRIDE; | 321 virtual void HideUserPodCustomIcon(const std::string& username) OVERRIDE; |
| 322 virtual void EnableInput() OVERRIDE; | 322 virtual void EnableInput() OVERRIDE; |
| 323 virtual void SetAuthType(const std::string& username, | 323 virtual void SetAuthType(const std::string& username, |
| 324 ScreenlockBridge::LockHandler::AuthType auth_type, | 324 SigninScreenBridge::LockHandler::AuthType auth_type, |
| 325 const base::string16& initial_value) OVERRIDE; | 325 const base::string16& initial_value) OVERRIDE; |
| 326 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( | 326 virtual SigninScreenBridge::LockHandler::AuthType GetAuthType( |
| 327 const std::string& username) const OVERRIDE; | 327 const std::string& username) const OVERRIDE; |
| 328 virtual void Unlock(const std::string& user_email) OVERRIDE; | 328 virtual void Unlock(const std::string& user_email) OVERRIDE; |
| 329 virtual void AttemptUserClickLogin(const std::string& user_email, | 329 virtual void AttemptUserClickLogin(const std::string& user_email, |
| 330 const std::string& secret, | 330 const std::string& secret, |
| 331 const std::string& key_label) OVERRIDE; | 331 const std::string& key_label) OVERRIDE; |
| 332 | 332 |
| 333 // TouchViewControllerDelegate::Observer implementation: | 333 // TouchViewControllerDelegate::Observer implementation: |
| 334 virtual void OnMaximizeModeStarted() OVERRIDE; | 334 virtual void OnMaximizeModeStarted() OVERRIDE; |
| 335 virtual void OnMaximizeModeEnded() OVERRIDE; | 335 virtual void OnMaximizeModeEnded() OVERRIDE; |
| 336 | 336 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 bool is_enrolling_consumer_management_; | 505 bool is_enrolling_consumer_management_; |
| 506 | 506 |
| 507 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 507 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
| 508 | 508 |
| 509 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 509 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 510 }; | 510 }; |
| 511 | 511 |
| 512 } // namespace chromeos | 512 } // namespace chromeos |
| 513 | 513 |
| 514 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 514 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |