| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
| 13 #include "chrome/browser/chromeos/login/screens/gaia_screen.h" | |
| 14 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" | |
| 15 #include "chrome/browser/chromeos/login/ui/login_display.h" | 13 #include "chrome/browser/chromeos/login/ui/login_display.h" |
| 16 #include "chrome/browser/chromeos/login/users/user.h" | 14 #include "chrome/browser/chromeos/login/users/user.h" |
| 17 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 15 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
| 18 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 16 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 19 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
| 20 #include "ui/wm/core/user_activity_observer.h" | 18 #include "ui/wm/core/user_activity_observer.h" |
| 21 | 19 |
| 22 namespace chromeos { | 20 namespace chromeos { |
| 23 // WebUI-based login UI implementation. | 21 // WebUI-based login UI implementation. |
| 24 class WebUILoginDisplay : public LoginDisplay, | 22 class WebUILoginDisplay : public LoginDisplay, |
| 25 public NativeWindowDelegate, | 23 public NativeWindowDelegate, |
| 26 public SigninScreenHandlerDelegate, | 24 public SigninScreenHandlerDelegate, |
| 27 public wm::UserActivityObserver { | 25 public wm::UserActivityObserver { |
| 28 public: | 26 public: |
| 29 explicit WebUILoginDisplay(LoginDisplay::Delegate* delegate); | 27 explicit WebUILoginDisplay(LoginDisplay::Delegate* delegate); |
| 30 virtual ~WebUILoginDisplay(); | 28 virtual ~WebUILoginDisplay(); |
| 31 | 29 |
| 32 // LoginDisplay implementation: | 30 // LoginDisplay implementation: |
| 33 virtual void ClearAndEnablePassword() OVERRIDE; | 31 virtual void ClearAndEnablePassword() OVERRIDE; |
| 34 virtual void Init(const UserList& users, | 32 virtual void Init(const UserList& users, |
| 35 bool show_guest, | 33 bool show_guest, |
| 36 bool show_users, | 34 bool show_users, |
| 37 bool show_new_user) OVERRIDE; | 35 bool show_new_user) OVERRIDE; |
| 38 virtual void OnPreferencesChanged() OVERRIDE; | 36 virtual void OnPreferencesChanged() OVERRIDE; |
| 39 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; | 37 virtual void OnBeforeUserRemoved(const std::string& username) OVERRIDE; |
| 40 virtual void OnUserImageChanged(const User& user) OVERRIDE; | 38 virtual void OnUserImageChanged(const User& user) OVERRIDE; |
| 41 virtual void OnUserRemoved(const std::string& username) OVERRIDE; | 39 virtual void OnUserRemoved(const std::string& username) OVERRIDE; |
| 40 virtual void OnFadeOut() OVERRIDE; |
| 41 virtual void OnLoginSuccess(const std::string& username) OVERRIDE; |
| 42 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; | 42 virtual void SetUIEnabled(bool is_enabled) OVERRIDE; |
| 43 virtual void SelectPod(int index) OVERRIDE; |
| 43 virtual void ShowError(int error_msg_id, | 44 virtual void ShowError(int error_msg_id, |
| 44 int login_attempts, | 45 int login_attempts, |
| 45 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; | 46 HelpAppLauncher::HelpTopic help_topic_id) OVERRIDE; |
| 46 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) OVERRIDE; | 47 virtual void ShowErrorScreen(LoginDisplay::SigninError error_id) OVERRIDE; |
| 47 virtual void ShowGaiaPasswordChanged(const std::string& username) OVERRIDE; | 48 virtual void ShowGaiaPasswordChanged(const std::string& username) OVERRIDE; |
| 48 virtual void ShowPasswordChangedDialog(bool show_password_error) OVERRIDE; | 49 virtual void ShowPasswordChangedDialog(bool show_password_error) OVERRIDE; |
| 49 virtual void ShowSigninUI(const std::string& email) OVERRIDE; | 50 virtual void ShowSigninUI(const std::string& email) OVERRIDE; |
| 50 virtual void ShowControlBar(bool show) OVERRIDE; | 51 virtual void ShowControlBar(bool show) OVERRIDE; |
| 51 | 52 |
| 52 // NativeWindowDelegate implementation: | 53 // NativeWindowDelegate implementation: |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual void LoginAsKioskApp(const std::string& app_id, | 87 virtual void LoginAsKioskApp(const std::string& app_id, |
| 87 bool diagnostic_mode) OVERRIDE; | 88 bool diagnostic_mode) OVERRIDE; |
| 88 | 89 |
| 89 // wm::UserActivityDetector implementation: | 90 // wm::UserActivityDetector implementation: |
| 90 virtual void OnUserActivity(const ui::Event* event) OVERRIDE; | 91 virtual void OnUserActivity(const ui::Event* event) OVERRIDE; |
| 91 | 92 |
| 92 private: | 93 private: |
| 93 void StartPasswordClearTimer(); | 94 void StartPasswordClearTimer(); |
| 94 void OnPasswordClearTimerExpired(); | 95 void OnPasswordClearTimerExpired(); |
| 95 | 96 |
| 97 // Set of Users that are visible. |
| 98 UserList users_; |
| 99 |
| 96 // Whether to show guest login. | 100 // Whether to show guest login. |
| 97 bool show_guest_; | 101 bool show_guest_; |
| 98 | 102 |
| 99 // Weather to show the user pods or a GAIA sign in. | 103 // Weather to show the user pods or a GAIA sign in. |
| 100 // Public sessions are always shown. | 104 // Public sessions are always shown. |
| 101 bool show_users_; | 105 bool show_users_; |
| 102 | 106 |
| 103 // Whether to show add new user. | 107 // Whether to show add new user. |
| 104 bool show_new_user_; | 108 bool show_new_user_; |
| 105 | 109 |
| 106 // Timer for measuring idle state duration before password clear. | 110 // Timer for measuring idle state duration before password clear. |
| 107 base::OneShotTimer<WebUILoginDisplay> password_clear_timer_; | 111 base::OneShotTimer<WebUILoginDisplay> password_clear_timer_; |
| 108 | 112 |
| 109 // Reference to the WebUI handling layer for the login screen | 113 // Reference to the WebUI handling layer for the login screen |
| 110 LoginDisplayWebUIHandler* webui_handler_; | 114 LoginDisplayWebUIHandler* webui_handler_; |
| 111 | 115 |
| 112 scoped_ptr<GaiaScreen> gaia_screen_; | |
| 113 scoped_ptr<UserSelectionScreen> user_selection_screen_; | |
| 114 | |
| 115 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay); | 116 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay); |
| 116 }; | 117 }; |
| 117 | 118 |
| 118 } // namespace chromeos | 119 } // namespace chromeos |
| 119 | 120 |
| 120 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ | 121 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ |
| OLD | NEW |