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_SCREENS_USER_SELECTION_SCREEN_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/timer/timer.h" | 13 #include "base/timer/timer.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" | 15 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" |
16 #include "chrome/browser/chromeos/login/ui/login_display.h" | 16 #include "chrome/browser/chromeos/login/ui/login_display.h" |
17 #include "chrome/browser/chromeos/login/ui/models/user_board_model.h" | 17 #include "chrome/browser/chromeos/login/ui/models/user_board_model.h" |
18 #include "chrome/browser/signin/screenlock_bridge.h" | 18 #include "components/proximity_auth/screenlock_bridge.h" |
19 #include "components/user_manager/user.h" | 19 #include "components/user_manager/user.h" |
20 #include "components/user_manager/user_id.h" | 20 #include "components/user_manager/user_id.h" |
21 #include "ui/base/user_activity/user_activity_observer.h" | 21 #include "ui/base/user_activity/user_activity_observer.h" |
22 | 22 |
23 class EasyUnlockService; | 23 class EasyUnlockService; |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 | 26 |
27 class LoginDisplayWebUIHandler; | 27 class LoginDisplayWebUIHandler; |
28 class UserBoardView; | 28 class UserBoardView; |
29 | 29 |
30 // This class represents User Selection screen: user pod-based login screen. | 30 // This class represents User Selection screen: user pod-based login screen. |
31 class UserSelectionScreen : public ui::UserActivityObserver, | 31 class UserSelectionScreen |
32 public ScreenlockBridge::LockHandler, | 32 : public ui::UserActivityObserver, |
33 public UserBoardModel { | 33 public proximity_auth::ScreenlockBridge::LockHandler, |
| 34 public UserBoardModel { |
34 public: | 35 public: |
35 explicit UserSelectionScreen(const std::string& display_type); | 36 explicit UserSelectionScreen(const std::string& display_type); |
36 ~UserSelectionScreen() override; | 37 ~UserSelectionScreen() override; |
37 | 38 |
38 void SetLoginDisplayDelegate(LoginDisplay::Delegate* login_display_delegate); | 39 void SetLoginDisplayDelegate(LoginDisplay::Delegate* login_display_delegate); |
39 void SetHandler(LoginDisplayWebUIHandler* handler); | 40 void SetHandler(LoginDisplayWebUIHandler* handler); |
40 void SetView(UserBoardView* view); | 41 void SetView(UserBoardView* view); |
41 | 42 |
42 static const user_manager::UserList PrepareUserListForSending( | 43 static const user_manager::UserList PrepareUserListForSending( |
43 const user_manager::UserList& users, | 44 const user_manager::UserList& users, |
(...skipping 10 matching lines...) Expand all Loading... |
54 void OnPasswordClearTimerExpired(); | 55 void OnPasswordClearTimerExpired(); |
55 | 56 |
56 void HandleGetUsers(); | 57 void HandleGetUsers(); |
57 void CheckUserStatus(const std::string& user_id); | 58 void CheckUserStatus(const std::string& user_id); |
58 | 59 |
59 // ui::UserActivityDetector implementation: | 60 // ui::UserActivityDetector implementation: |
60 void OnUserActivity(const ui::Event* event) override; | 61 void OnUserActivity(const ui::Event* event) override; |
61 | 62 |
62 void InitEasyUnlock(); | 63 void InitEasyUnlock(); |
63 | 64 |
64 // ScreenlockBridge::LockHandler implementation: | 65 // proximity_auth::ScreenlockBridge::LockHandler implementation: |
65 void ShowBannerMessage(const base::string16& message) override; | 66 void ShowBannerMessage(const base::string16& message) override; |
66 void ShowUserPodCustomIcon( | 67 void ShowUserPodCustomIcon( |
67 const std::string& user_email, | 68 const std::string& user_email, |
68 const ScreenlockBridge::UserPodCustomIconOptions& icon) override; | 69 const proximity_auth::ScreenlockBridge::UserPodCustomIconOptions& icon) |
| 70 override; |
69 void HideUserPodCustomIcon(const std::string& user_email) override; | 71 void HideUserPodCustomIcon(const std::string& user_email) override; |
70 | 72 |
71 void EnableInput() override; | 73 void EnableInput() override; |
72 void SetAuthType(const std::string& user_email, | 74 void SetAuthType(const std::string& user_email, |
73 AuthType auth_type, | 75 AuthType auth_type, |
74 const base::string16& auth_value) override; | 76 const base::string16& auth_value) override; |
75 AuthType GetAuthType(const std::string& user_email) const override; | 77 AuthType GetAuthType(const std::string& user_email) const override; |
76 ScreenType GetScreenType() const override; | 78 ScreenType GetScreenType() const override; |
77 | 79 |
78 void Unlock(const std::string& user_email) override; | 80 void Unlock(const std::string& user_email) override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 bool show_guest_; | 130 bool show_guest_; |
129 | 131 |
130 // Purpose of the screen (see constants in OobeUI). | 132 // Purpose of the screen (see constants in OobeUI). |
131 const std::string display_type_; | 133 const std::string display_type_; |
132 | 134 |
133 // Set of Users that are visible. | 135 // Set of Users that are visible. |
134 user_manager::UserList users_; | 136 user_manager::UserList users_; |
135 | 137 |
136 // Map of usernames to their current authentication type. If a user is not | 138 // Map of usernames to their current authentication type. If a user is not |
137 // contained in the map, it is using the default authentication type. | 139 // contained in the map, it is using the default authentication type. |
138 std::map<std::string, ScreenlockBridge::LockHandler::AuthType> | 140 std::map<std::string, proximity_auth::ScreenlockBridge::LockHandler::AuthType> |
139 user_auth_type_map_; | 141 user_auth_type_map_; |
140 | 142 |
141 // Timer for measuring idle state duration before password clear. | 143 // Timer for measuring idle state duration before password clear. |
142 base::OneShotTimer<UserSelectionScreen> password_clear_timer_; | 144 base::OneShotTimer<UserSelectionScreen> password_clear_timer_; |
143 | 145 |
144 // Token handler util for checking user OAuth token status. | 146 // Token handler util for checking user OAuth token status. |
145 scoped_ptr<TokenHandleUtil> token_handle_util_; | 147 scoped_ptr<TokenHandleUtil> token_handle_util_; |
146 | 148 |
147 base::WeakPtrFactory<UserSelectionScreen> weak_factory_; | 149 base::WeakPtrFactory<UserSelectionScreen> weak_factory_; |
148 | 150 |
149 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); | 151 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); |
150 }; | 152 }; |
151 | 153 |
152 } // namespace chromeos | 154 } // namespace chromeos |
153 | 155 |
154 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ | 156 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ |
OLD | NEW |