| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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/screenlock_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/ime/input_method_manager.h" |
| 31 #include "chromeos/network/portal_detector/network_portal_detector.h" | 32 #include "chromeos/network/portal_detector/network_portal_detector.h" |
| 32 #include "components/user_manager/user_manager.h" | 33 #include "components/user_manager/user_manager.h" |
| 33 #include "content/public/browser/notification_observer.h" | 34 #include "content/public/browser/notification_observer.h" |
| 34 #include "content/public/browser/notification_registrar.h" | 35 #include "content/public/browser/notification_registrar.h" |
| 35 #include "content/public/browser/web_ui.h" | 36 #include "content/public/browser/web_ui.h" |
| 36 #include "net/base/net_errors.h" | 37 #include "net/base/net_errors.h" |
| 37 #include "ui/events/event_handler.h" | 38 #include "ui/events/event_handler.h" |
| 38 | 39 |
| 39 namespace base { | 40 namespace base { |
| 40 class DictionaryValue; | 41 class DictionaryValue; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 207 |
| 207 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay | 208 // A class that handles the WebUI hooks in sign-in screen in OobeDisplay |
| 208 // and LoginDisplay. | 209 // and LoginDisplay. |
| 209 class SigninScreenHandler | 210 class SigninScreenHandler |
| 210 : public BaseScreenHandler, | 211 : public BaseScreenHandler, |
| 211 public LoginDisplayWebUIHandler, | 212 public LoginDisplayWebUIHandler, |
| 212 public content::NotificationObserver, | 213 public content::NotificationObserver, |
| 213 public ScreenlockBridge::LockHandler, | 214 public ScreenlockBridge::LockHandler, |
| 214 public NetworkStateInformer::NetworkStateInformerObserver, | 215 public NetworkStateInformer::NetworkStateInformerObserver, |
| 215 public input_method::ImeKeyboard::Observer, | 216 public input_method::ImeKeyboard::Observer, |
| 216 public TouchViewControllerDelegate::Observer { | 217 public TouchViewControllerDelegate::Observer, |
| 218 public OobeUI::Observer { |
| 217 public: | 219 public: |
| 218 SigninScreenHandler( | 220 SigninScreenHandler( |
| 219 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 221 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
| 220 ErrorScreenActor* error_screen_actor, | 222 ErrorScreenActor* error_screen_actor, |
| 221 CoreOobeActor* core_oobe_actor, | 223 CoreOobeActor* core_oobe_actor, |
| 222 GaiaScreenHandler* gaia_screen_handler); | 224 GaiaScreenHandler* gaia_screen_handler); |
| 223 virtual ~SigninScreenHandler(); | 225 virtual ~SigninScreenHandler(); |
| 224 | 226 |
| 225 // Shows the sign in screen. | 227 // Shows the sign in screen. |
| 226 void Show(const LoginScreenContext& context); | 228 void Show(const LoginScreenContext& context); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 239 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; | 241 virtual void UpdateState(ErrorScreenActor::ErrorReason reason) OVERRIDE; |
| 240 | 242 |
| 241 // Required Local State preferences. | 243 // Required Local State preferences. |
| 242 static void RegisterPrefs(PrefRegistrySimple* registry); | 244 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 243 | 245 |
| 244 void set_kiosk_enable_flow_aborted_callback_for_test( | 246 void set_kiosk_enable_flow_aborted_callback_for_test( |
| 245 const base::Closure& callback) { | 247 const base::Closure& callback) { |
| 246 kiosk_enable_flow_aborted_callback_for_test_ = callback; | 248 kiosk_enable_flow_aborted_callback_for_test_ = callback; |
| 247 } | 249 } |
| 248 | 250 |
| 251 // OobeUI::Observer implemetation. |
| 252 virtual void OnCurrentScreenChanged(OobeUI::Screen current_screen, |
| 253 OobeUI::Screen new_screen) OVERRIDE; |
| 254 |
| 255 // Returns Least Used User login Input method. |
| 256 std::string GetUserLRUInputMethod(const std::string& username) const; |
| 257 |
| 249 private: | 258 private: |
| 250 enum UIState { | 259 enum UIState { |
| 251 UI_STATE_UNKNOWN = 0, | 260 UI_STATE_UNKNOWN = 0, |
| 252 UI_STATE_GAIA_SIGNIN, | 261 UI_STATE_GAIA_SIGNIN, |
| 253 UI_STATE_ACCOUNT_PICKER, | 262 UI_STATE_ACCOUNT_PICKER, |
| 254 }; | 263 }; |
| 255 | 264 |
| 256 friend class GaiaScreenHandler; | 265 friend class GaiaScreenHandler; |
| 257 friend class ReportDnsCacheClearedOnUIThread; | 266 friend class ReportDnsCacheClearedOnUIThread; |
| 258 friend class SupervisedUserCreationScreenHandler; | 267 friend class SupervisedUserCreationScreenHandler; |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 bool IsSigninScreenHiddenByError() const; | 424 bool IsSigninScreenHiddenByError() const; |
| 416 | 425 |
| 417 // Returns true if guest signin is allowed. | 426 // Returns true if guest signin is allowed. |
| 418 bool IsGuestSigninAllowed() const; | 427 bool IsGuestSigninAllowed() const; |
| 419 | 428 |
| 420 // Returns true if offline login is allowed. | 429 // Returns true if offline login is allowed. |
| 421 bool IsOfflineLoginAllowed() const; | 430 bool IsOfflineLoginAllowed() const; |
| 422 | 431 |
| 423 bool ShouldLoadGaia() const; | 432 bool ShouldLoadGaia() const; |
| 424 | 433 |
| 425 // Update current input method (namely keyboard layout) to LRU by this user. | 434 // Update current input method (namely keyboard layout) in the given IME state |
| 426 void SetUserInputMethod(const std::string& username); | 435 // to LRU by this user. |
| 436 void SetUserInputMethod(const std::string& username, |
| 437 input_method::InputMethodManager::State* ime_state); |
| 427 | 438 |
| 428 // Invoked when auto enrollment check progresses to decide whether to | 439 // Invoked when auto enrollment check progresses to decide whether to |
| 429 // continue kiosk enable flow. Kiosk enable flow is resumed when | 440 // continue kiosk enable flow. Kiosk enable flow is resumed when |
| 430 // |state| indicates that enrollment is not applicable. | 441 // |state| indicates that enrollment is not applicable. |
| 431 void ContinueKioskEnableFlow(policy::AutoEnrollmentState state); | 442 void ContinueKioskEnableFlow(policy::AutoEnrollmentState state); |
| 432 | 443 |
| 433 // Shows signin. | 444 // Shows signin. |
| 434 void OnShowAddUser(); | 445 void OnShowAddUser(); |
| 435 | 446 |
| 436 GaiaScreenHandler::FrameState FrameState() const; | 447 GaiaScreenHandler::FrameState FrameState() const; |
| 437 net::Error FrameError() const; | 448 net::Error FrameError() const; |
| 438 | 449 |
| 439 // input_method::ImeKeyboard::Observer implementation: | 450 // input_method::ImeKeyboard::Observer implementation: |
| 440 virtual void OnCapsLockChanged(bool enabled) OVERRIDE; | 451 virtual void OnCapsLockChanged(bool enabled) OVERRIDE; |
| 441 | 452 |
| 453 // Returns OobeUI object of NULL. |
| 454 OobeUI* GetOobeUI() const; |
| 455 |
| 442 // Current UI state of the signin screen. | 456 // Current UI state of the signin screen. |
| 443 UIState ui_state_; | 457 UIState ui_state_; |
| 444 | 458 |
| 445 // A delegate that glues this handler with backend LoginDisplay. | 459 // A delegate that glues this handler with backend LoginDisplay. |
| 446 SigninScreenHandlerDelegate* delegate_; | 460 SigninScreenHandlerDelegate* delegate_; |
| 447 | 461 |
| 448 // A delegate used to get gfx::NativeWindow. | 462 // A delegate used to get gfx::NativeWindow. |
| 449 NativeWindowDelegate* native_window_delegate_; | 463 NativeWindowDelegate* native_window_delegate_; |
| 450 | 464 |
| 451 // Whether screen should be shown right after initialization. | 465 // Whether screen should be shown right after initialization. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 508 |
| 495 // Helper that retrieves the authenticated user's e-mail address. | 509 // Helper that retrieves the authenticated user's e-mail address. |
| 496 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; | 510 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; |
| 497 | 511 |
| 498 // Maximized mode controller delegate. | 512 // Maximized mode controller delegate. |
| 499 scoped_ptr<TouchViewControllerDelegate> max_mode_delegate_; | 513 scoped_ptr<TouchViewControllerDelegate> max_mode_delegate_; |
| 500 | 514 |
| 501 // Whether consumer management enrollment is in progress. | 515 // Whether consumer management enrollment is in progress. |
| 502 bool is_enrolling_consumer_management_; | 516 bool is_enrolling_consumer_management_; |
| 503 | 517 |
| 518 // Input Method Engine state used at signin screen. |
| 519 scoped_refptr<input_method::InputMethodManager::State> ime_state_; |
| 520 |
| 504 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 521 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
| 505 | 522 |
| 506 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 523 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
| 507 }; | 524 }; |
| 508 | 525 |
| 509 } // namespace chromeos | 526 } // namespace chromeos |
| 510 | 527 |
| 511 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 528 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
| OLD | NEW |