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