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/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 "chromeos/ime/ime_keyboard.h" | 30 #include "chromeos/ime/ime_keyboard.h" |
30 #include "chromeos/network/portal_detector/network_portal_detector.h" | 31 #include "chromeos/network/portal_detector/network_portal_detector.h" |
31 #include "components/user_manager/user_manager.h" | 32 #include "components/user_manager/user_manager.h" |
32 #include "content/public/browser/notification_observer.h" | 33 #include "content/public/browser/notification_observer.h" |
33 #include "content/public/browser/notification_registrar.h" | 34 #include "content/public/browser/notification_registrar.h" |
34 #include "content/public/browser/web_ui.h" | 35 #include "content/public/browser/web_ui.h" |
35 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
36 #include "ui/events/event_handler.h" | 37 #include "ui/events/event_handler.h" |
37 | 38 |
38 namespace base { | 39 namespace base { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 }; | 205 }; |
205 | 206 |
206 // 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 |
207 // and LoginDisplay. | 208 // and LoginDisplay. |
208 class SigninScreenHandler | 209 class SigninScreenHandler |
209 : public BaseScreenHandler, | 210 : public BaseScreenHandler, |
210 public LoginDisplayWebUIHandler, | 211 public LoginDisplayWebUIHandler, |
211 public content::NotificationObserver, | 212 public content::NotificationObserver, |
212 public ScreenlockBridge::LockHandler, | 213 public ScreenlockBridge::LockHandler, |
213 public NetworkStateInformer::NetworkStateInformerObserver, | 214 public NetworkStateInformer::NetworkStateInformerObserver, |
214 public input_method::ImeKeyboard::Observer { | 215 public input_method::ImeKeyboard::Observer, |
| 216 public TouchViewControllerDelegate::Observer { |
215 public: | 217 public: |
216 SigninScreenHandler( | 218 SigninScreenHandler( |
217 const scoped_refptr<NetworkStateInformer>& network_state_informer, | 219 const scoped_refptr<NetworkStateInformer>& network_state_informer, |
218 ErrorScreenActor* error_screen_actor, | 220 ErrorScreenActor* error_screen_actor, |
219 CoreOobeActor* core_oobe_actor, | 221 CoreOobeActor* core_oobe_actor, |
220 GaiaScreenHandler* gaia_screen_handler); | 222 GaiaScreenHandler* gaia_screen_handler); |
221 virtual ~SigninScreenHandler(); | 223 virtual ~SigninScreenHandler(); |
222 | 224 |
223 // Shows the sign in screen. | 225 // Shows the sign in screen. |
224 void Show(const LoginScreenContext& context); | 226 void Show(const LoginScreenContext& context); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const ScreenlockBridge::UserPodCustomIconOptions& icon) OVERRIDE; | 320 const ScreenlockBridge::UserPodCustomIconOptions& icon) OVERRIDE; |
319 virtual void HideUserPodCustomIcon(const std::string& username) OVERRIDE; | 321 virtual void HideUserPodCustomIcon(const std::string& username) OVERRIDE; |
320 virtual void EnableInput() OVERRIDE; | 322 virtual void EnableInput() OVERRIDE; |
321 virtual void SetAuthType(const std::string& username, | 323 virtual void SetAuthType(const std::string& username, |
322 ScreenlockBridge::LockHandler::AuthType auth_type, | 324 ScreenlockBridge::LockHandler::AuthType auth_type, |
323 const base::string16& initial_value) OVERRIDE; | 325 const base::string16& initial_value) OVERRIDE; |
324 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( | 326 virtual ScreenlockBridge::LockHandler::AuthType GetAuthType( |
325 const std::string& username) const OVERRIDE; | 327 const std::string& username) const OVERRIDE; |
326 virtual void Unlock(const std::string& user_email) OVERRIDE; | 328 virtual void Unlock(const std::string& user_email) OVERRIDE; |
327 | 329 |
| 330 // TouchViewControllerDelegate::Observer implementation: |
| 331 virtual void OnMaximizeModeStarted() OVERRIDE; |
| 332 virtual void OnMaximizeModeEnded() OVERRIDE; |
| 333 |
328 // Updates authentication extension. Called when device settings that affect | 334 // Updates authentication extension. Called when device settings that affect |
329 // sign-in (allow BWSI and allow whitelist) are changed. | 335 // sign-in (allow BWSI and allow whitelist) are changed. |
330 void UserSettingsChanged(); | 336 void UserSettingsChanged(); |
331 void UpdateAddButtonStatus(); | 337 void UpdateAddButtonStatus(); |
332 | 338 |
333 // Restore input focus to current user pod. | 339 // Restore input focus to current user pod. |
334 void RefocusCurrentPod(); | 340 void RefocusCurrentPod(); |
335 | 341 |
336 // WebUI message handlers. | 342 // WebUI message handlers. |
337 void HandleGetUsers(); | 343 void HandleGetUsers(); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void HandleShowLoadingTimeoutError(); | 375 void HandleShowLoadingTimeoutError(); |
370 void HandleUpdateOfflineLogin(bool offline_login_active); | 376 void HandleUpdateOfflineLogin(bool offline_login_active); |
371 void HandleShowSupervisedUserCreationScreen(); | 377 void HandleShowSupervisedUserCreationScreen(); |
372 void HandleFocusPod(const std::string& user_id); | 378 void HandleFocusPod(const std::string& user_id); |
373 void HandleHardlockPod(const std::string& user_id); | 379 void HandleHardlockPod(const std::string& user_id); |
374 void HandleLaunchKioskApp(const std::string& app_id, bool diagnostic_mode); | 380 void HandleLaunchKioskApp(const std::string& app_id, bool diagnostic_mode); |
375 void HandleRetrieveAuthenticatedUserEmail(double attempt_token); | 381 void HandleRetrieveAuthenticatedUserEmail(double attempt_token); |
376 void HandleGetPublicSessionKeyboardLayouts(const std::string& user_id, | 382 void HandleGetPublicSessionKeyboardLayouts(const std::string& user_id, |
377 const std::string& locale); | 383 const std::string& locale); |
378 void HandleCancelConsumerManagementEnrollment(); | 384 void HandleCancelConsumerManagementEnrollment(); |
| 385 void HandleGetTouchViewState(); |
379 | 386 |
380 // Sends the list of |keyboard_layouts| available for the |locale| that is | 387 // Sends the list of |keyboard_layouts| available for the |locale| that is |
381 // currently selected for the public session identified by |user_id|. | 388 // currently selected for the public session identified by |user_id|. |
382 void SendPublicSessionKeyboardLayouts( | 389 void SendPublicSessionKeyboardLayouts( |
383 const std::string& user_id, | 390 const std::string& user_id, |
384 const std::string& locale, | 391 const std::string& locale, |
385 scoped_ptr<base::ListValue> keyboard_layouts); | 392 scoped_ptr<base::ListValue> keyboard_layouts); |
386 | 393 |
387 // Returns true iff | 394 // Returns true iff |
388 // (i) log in is restricted to some user list, | 395 // (i) log in is restricted to some user list, |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 488 |
482 base::Closure kiosk_enable_flow_aborted_callback_for_test_; | 489 base::Closure kiosk_enable_flow_aborted_callback_for_test_; |
483 | 490 |
484 // Non-owning ptr. | 491 // Non-owning ptr. |
485 // TODO(ygorshenin@): remove this dependency. | 492 // TODO(ygorshenin@): remove this dependency. |
486 GaiaScreenHandler* gaia_screen_handler_; | 493 GaiaScreenHandler* gaia_screen_handler_; |
487 | 494 |
488 // Helper that retrieves the authenticated user's e-mail address. | 495 // Helper that retrieves the authenticated user's e-mail address. |
489 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; | 496 scoped_ptr<AuthenticatedUserEmailRetriever> email_retriever_; |
490 | 497 |
| 498 // Maximized mode controller delegate. |
| 499 scoped_ptr<TouchViewControllerDelegate> max_mode_delegate_; |
| 500 |
491 // Whether consumer management enrollment is in progress. | 501 // Whether consumer management enrollment is in progress. |
492 bool is_enrolling_consumer_management_; | 502 bool is_enrolling_consumer_management_; |
493 | 503 |
494 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; | 504 base::WeakPtrFactory<SigninScreenHandler> weak_factory_; |
495 | 505 |
496 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); | 506 DISALLOW_COPY_AND_ASSIGN(SigninScreenHandler); |
497 }; | 507 }; |
498 | 508 |
499 } // namespace chromeos | 509 } // namespace chromeos |
500 | 510 |
501 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ | 511 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_SIGNIN_SCREEN_HANDLER_H_ |
OLD | NEW |