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 |
| 258 void SetFocusPODCallbackForTesting(base::Closure callback); |
| 259 |
249 private: | 260 private: |
250 enum UIState { | 261 enum UIState { |
251 UI_STATE_UNKNOWN = 0, | 262 UI_STATE_UNKNOWN = 0, |
252 UI_STATE_GAIA_SIGNIN, | 263 UI_STATE_GAIA_SIGNIN, |
253 UI_STATE_ACCOUNT_PICKER, | 264 UI_STATE_ACCOUNT_PICKER, |
254 }; | 265 }; |
255 | 266 |
256 friend class GaiaScreenHandler; | 267 friend class GaiaScreenHandler; |
257 friend class ReportDnsCacheClearedOnUIThread; | 268 friend class ReportDnsCacheClearedOnUIThread; |
258 friend class SupervisedUserCreationScreenHandler; | 269 friend class SupervisedUserCreationScreenHandler; |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 bool IsSigninScreenHiddenByError() const; | 426 bool IsSigninScreenHiddenByError() const; |
416 | 427 |
417 // Returns true if guest signin is allowed. | 428 // Returns true if guest signin is allowed. |
418 bool IsGuestSigninAllowed() const; | 429 bool IsGuestSigninAllowed() const; |
419 | 430 |
420 // Returns true if offline login is allowed. | 431 // Returns true if offline login is allowed. |
421 bool IsOfflineLoginAllowed() const; | 432 bool IsOfflineLoginAllowed() const; |
422 | 433 |
423 bool ShouldLoadGaia() const; | 434 bool ShouldLoadGaia() const; |
424 | 435 |
425 // Update current input method (namely keyboard layout) to LRU by this user. | 436 // Update current input method (namely keyboard layout) in the given IME state |
426 void SetUserInputMethod(const std::string& username); | 437 // to LRU by this user. |
| 438 void SetUserInputMethod(const std::string& username, |
| 439 input_method::InputMethodManager::State* ime_state); |
427 | 440 |
428 // Invoked when auto enrollment check progresses to decide whether to | 441 // Invoked when auto enrollment check progresses to decide whether to |
429 // continue kiosk enable flow. Kiosk enable flow is resumed when | 442 // continue kiosk enable flow. Kiosk enable flow is resumed when |
430 // |state| indicates that enrollment is not applicable. | 443 // |state| indicates that enrollment is not applicable. |
431 void ContinueKioskEnableFlow(policy::AutoEnrollmentState state); | 444 void ContinueKioskEnableFlow(policy::AutoEnrollmentState state); |
432 | 445 |
433 // Shows signin. | 446 // Shows signin. |
434 void OnShowAddUser(); | 447 void OnShowAddUser(); |
435 | 448 |
436 GaiaScreenHandler::FrameState FrameState() const; | 449 GaiaScreenHandler::FrameState FrameState() const; |
437 net::Error FrameError() const; | 450 net::Error FrameError() const; |
438 | 451 |
439 // input_method::ImeKeyboard::Observer implementation: | 452 // input_method::ImeKeyboard::Observer implementation: |
440 virtual void OnCapsLockChanged(bool enabled) OVERRIDE; | 453 virtual void OnCapsLockChanged(bool enabled) OVERRIDE; |
441 | 454 |
| 455 // Returns OobeUI object of NULL. |
| 456 OobeUI* GetOobeUI() const; |
| 457 |
442 // Current UI state of the signin screen. | 458 // Current UI state of the signin screen. |
443 UIState ui_state_; | 459 UIState ui_state_; |
444 | 460 |
445 // A delegate that glues this handler with backend LoginDisplay. | 461 // A delegate that glues this handler with backend LoginDisplay. |
446 SigninScreenHandlerDelegate* delegate_; | 462 SigninScreenHandlerDelegate* delegate_; |
447 | 463 |
448 // A delegate used to get gfx::NativeWindow. | 464 // A delegate used to get gfx::NativeWindow. |
449 NativeWindowDelegate* native_window_delegate_; | 465 NativeWindowDelegate* native_window_delegate_; |
450 | 466 |
451 // Whether screen should be shown right after initialization. | 467 // Whether screen should be shown right after initialization. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 510 |
495 // Helper that retrieves the authenticated user's e-mail address. | 511 // Helper that retrieves the authenticated user's e-mail address. |
496 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; | 512 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; |
497 | 513 |
498 // Maximized mode controller delegate. | 514 // Maximized mode controller delegate. |
499 scoped_ptr<TouchViewControllerDelegate> max_mode_delegate_; | 515 scoped_ptr<TouchViewControllerDelegate> max_mode_delegate_; |
500 | 516 |
501 // Whether consumer management enrollment is in progress. | 517 // Whether consumer management enrollment is in progress. |
502 bool is_enrolling_consumer_management_; | 518 bool is_enrolling_consumer_management_; |
503 | 519 |
| 520 // Input Method Engine state used at signin screen. |
| 521 scoped_refptr<input_method::InputMethodManager::State> ime_state_; |
| 522 |
| 523 // This callback captures "focusPod finished" event for tests. |
| 524 base::Closure test_focus_pod_callback_; |
| 525 |
| 526 // True if SigninScreenHandler has already been added to OobeUI observers. |
| 527 bool oobe_ui_observer_added_; |
| 528 |
504 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 529 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
505 | 530 |
506 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 531 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
507 }; | 532 }; |
508 | 533 |
509 } // namespace chromeos | 534 } // namespace chromeos |
510 | 535 |
511 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 536 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
OLD | NEW |