Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1467)

Side by Side Diff: chrome/browser/chromeos/login/ui/webui_login_display.h

Issue 293613003: ChromeOS login webui refactoring: split user selection/gaia login screens. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 ShowBannerMessage(const std::string& message) OVERRIDE; 43 virtual void ShowBannerMessage(const std::string& message) OVERRIDE;
45 virtual void ShowUserPodButton(const std::string& username, 44 virtual void ShowUserPodButton(const std::string& username,
46 const std::string& iconURL, 45 const std::string& iconURL,
47 const base::Closure& click_callback) OVERRIDE; 46 const base::Closure& click_callback) OVERRIDE;
48 virtual void HideUserPodButton(const std::string& username) OVERRIDE; 47 virtual void HideUserPodButton(const std::string& username) OVERRIDE;
49 virtual void SetAuthType(const std::string& username, 48 virtual void SetAuthType(const std::string& username,
50 AuthType auth_type, 49 AuthType auth_type,
51 const std::string& initial_value) OVERRIDE; 50 const std::string& initial_value) OVERRIDE;
52 virtual AuthType GetAuthType(const std::string& username) const OVERRIDE; 51 virtual AuthType GetAuthType(const std::string& username) const OVERRIDE;
53 virtual void ShowError(int error_msg_id, 52 virtual void ShowError(int error_msg_id,
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual void LoginAsKioskApp(const std::string& app_id, 95 virtual void LoginAsKioskApp(const std::string& app_id,
97 bool diagnostic_mode) OVERRIDE; 96 bool diagnostic_mode) OVERRIDE;
98 97
99 // wm::UserActivityDetector implementation: 98 // wm::UserActivityDetector implementation:
100 virtual void OnUserActivity(const ui::Event* event) OVERRIDE; 99 virtual void OnUserActivity(const ui::Event* event) OVERRIDE;
101 100
102 private: 101 private:
103 void StartPasswordClearTimer(); 102 void StartPasswordClearTimer();
104 void OnPasswordClearTimerExpired(); 103 void OnPasswordClearTimerExpired();
105 104
106 // Set of Users that are visible.
107 UserList users_;
108
109 // Whether to show guest login. 105 // Whether to show guest login.
110 bool show_guest_; 106 bool show_guest_;
111 107
112 // Weather to show the user pods or a GAIA sign in. 108 // Weather to show the user pods or a GAIA sign in.
113 // Public sessions are always shown. 109 // Public sessions are always shown.
114 bool show_users_; 110 bool show_users_;
115 111
116 // Whether to show add new user. 112 // Whether to show add new user.
117 bool show_new_user_; 113 bool show_new_user_;
118 114
119 // Timer for measuring idle state duration before password clear. 115 // Timer for measuring idle state duration before password clear.
120 base::OneShotTimer<WebUILoginDisplay> password_clear_timer_; 116 base::OneShotTimer<WebUILoginDisplay> password_clear_timer_;
121 117
122 // Reference to the WebUI handling layer for the login screen 118 // Reference to the WebUI handling layer for the login screen
123 LoginDisplayWebUIHandler* webui_handler_; 119 LoginDisplayWebUIHandler* webui_handler_;
124 120
121 scoped_ptr<GaiaScreen> gaia_screen_;
122 scoped_ptr<UserSelectionScreen> user_selection_screen_;
123
125 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay); 124 DISALLOW_COPY_AND_ASSIGN(WebUILoginDisplay);
126 }; 125 };
127 126
128 } // namespace chromeos 127 } // namespace chromeos
129 128
130 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_ 129 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEBUI_LOGIN_DISPLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698