| 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> | |
| 9 #include <string> | 8 #include <string> |
| 10 | 9 |
| 11 #include "base/bind.h" | 10 #include "base/bind.h" |
| 12 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 13 #include "base/timer/timer.h" | |
| 14 #include "base/values.h" | |
| 15 #include "chrome/browser/chromeos/login/users/user.h" | 12 #include "chrome/browser/chromeos/login/users/user.h" |
| 16 #include "chrome/browser/signin/screenlock_bridge.h" | |
| 17 #include "ui/wm/core/user_activity_observer.h" | |
| 18 | 13 |
| 19 namespace chromeos { | 14 namespace chromeos { |
| 20 | 15 |
| 21 class LoginDisplayWebUIHandler; | 16 class LoginDisplayWebUIHandler; |
| 22 | 17 |
| 23 // This class represents User Selection screen: user pod-based login screen. | 18 // This class represents User Selection screen: user pod-based login screen. |
| 24 class UserSelectionScreen : public wm::UserActivityObserver { | 19 class UserSelectionScreen { |
| 25 public: | 20 public: |
| 26 UserSelectionScreen(); | 21 UserSelectionScreen(); |
| 27 virtual ~UserSelectionScreen(); | 22 virtual ~UserSelectionScreen(); |
| 28 | 23 |
| 29 void SetHandler(LoginDisplayWebUIHandler* handler); | 24 void SetHandler(LoginDisplayWebUIHandler* handler); |
| 30 | 25 |
| 31 void Init(const UserList& users, bool show_guest); | 26 void Init(const UserList& users); |
| 32 const UserList& GetUsers() const; | 27 const UserList& GetUsers() const; |
| 33 void OnUserImageChanged(const User& user); | 28 void OnUserImageChanged(const User& user); |
| 34 void OnBeforeUserRemoved(const std::string& username); | 29 void OnBeforeUserRemoved(const std::string& username); |
| 35 void OnUserRemoved(const std::string& username); | 30 void OnUserRemoved(const std::string& username); |
| 36 | 31 |
| 37 void OnPasswordClearTimerExpired(); | |
| 38 void SendUserList(bool animated); | |
| 39 void HandleGetUsers(); | |
| 40 void SetAuthType(const std::string& username, | |
| 41 ScreenlockBridge::LockHandler::AuthType auth_type); | |
| 42 ScreenlockBridge::LockHandler::AuthType GetAuthType( | |
| 43 const std::string& username) const; | |
| 44 | |
| 45 // wm::UserActivityDetector implementation: | |
| 46 virtual void OnUserActivity(const ui::Event* event) OVERRIDE; | |
| 47 | |
| 48 // Fills |user_dict| with information about |user|. | |
| 49 static void FillUserDictionary( | |
| 50 User* user, | |
| 51 bool is_owner, | |
| 52 bool is_signin_to_add, | |
| 53 ScreenlockBridge::LockHandler::AuthType auth_type, | |
| 54 base::DictionaryValue* user_dict); | |
| 55 | |
| 56 // Determines if user auth status requires online sign in. | |
| 57 static bool ShouldForceOnlineSignIn(const User* user); | |
| 58 | |
| 59 private: | 32 private: |
| 60 LoginDisplayWebUIHandler* handler_; | 33 LoginDisplayWebUIHandler* handler_; |
| 61 | 34 |
| 62 // Set of Users that are visible. | 35 // Set of Users that are visible. |
| 63 UserList users_; | 36 UserList users_; |
| 64 | 37 |
| 65 // Whether to show guest login. | |
| 66 bool show_guest_; | |
| 67 | |
| 68 // Map of usernames to their current authentication type. If a user is not | |
| 69 // contained in the map, it is using the default authentication type. | |
| 70 std::map<std::string, ScreenlockBridge::LockHandler::AuthType> | |
| 71 user_auth_type_map_; | |
| 72 | |
| 73 // Timer for measuring idle state duration before password clear. | |
| 74 base::OneShotTimer<UserSelectionScreen> password_clear_timer_; | |
| 75 | |
| 76 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); | 38 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); |
| 77 }; | 39 }; |
| 78 | 40 |
| 79 } // namespace chromeos | 41 } // namespace chromeos |
| 80 | 42 |
| 81 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ | 43 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ |
| OLD | NEW |