Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/bind.h" | 11 #include "base/bind.h" |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/timer/timer.h" | |
| 14 #include "chrome/browser/chromeos/login/ui/login_display.h" | |
| 12 #include "chrome/browser/chromeos/login/users/user.h" | 15 #include "chrome/browser/chromeos/login/users/user.h" |
| 16 #include "ui/wm/core/user_activity_observer.h" | |
| 13 | 17 |
| 14 namespace chromeos { | 18 namespace chromeos { |
| 15 | 19 |
| 16 class LoginDisplayWebUIHandler; | 20 class LoginDisplayWebUIHandler; |
| 17 | 21 |
| 18 // This class represents User Selection screen: user pod-based login screen. | 22 // This class represents User Selection screen: user pod-based login screen. |
| 19 class UserSelectionScreen { | 23 class UserSelectionScreen : public wm::UserActivityObserver { |
| 20 public: | 24 public: |
| 21 UserSelectionScreen(); | 25 UserSelectionScreen(); |
| 22 virtual ~UserSelectionScreen(); | 26 virtual ~UserSelectionScreen(); |
| 23 | 27 |
| 24 void SetHandler(LoginDisplayWebUIHandler* handler); | 28 void SetHandler(LoginDisplayWebUIHandler* handler); |
| 25 | 29 |
| 26 void Init(const UserList& users); | 30 void Init(const UserList& users, bool show_guest); |
| 27 const UserList& GetUsers() const; | 31 const UserList& GetUsers() const; |
| 28 void OnUserImageChanged(const User& user); | 32 void OnUserImageChanged(const User& user); |
| 29 void OnBeforeUserRemoved(const std::string& username); | 33 void OnBeforeUserRemoved(const std::string& username); |
| 30 void OnUserRemoved(const std::string& username); | 34 void OnUserRemoved(const std::string& username); |
| 31 void ShowUserPodButton(const std::string& username, | 35 void ShowUserPodButton(const std::string& username, |
| 32 const std::string& iconURL, | 36 const std::string& iconURL, |
| 33 const base::Closure& click_callback); | 37 const base::Closure& click_callback); |
| 34 void HideUserPodButton(const std::string& username); | 38 void HideUserPodButton(const std::string& username); |
| 35 | 39 |
| 40 void OnPasswordClearTimerExpired(); | |
| 41 void SendUserList(bool animated); | |
| 42 void SetAuthType(const std::string& user_id, | |
| 43 LoginDisplay::AuthType auth_type, | |
| 44 const std::string& initial_value); | |
| 45 LoginDisplay::AuthType GetAuthType(const std::string& user_id) const; | |
| 46 void HandleCustomButtonClicked(const std::string& user_id); | |
| 47 void HandleGetUsers(); | |
| 48 | |
| 49 // wm::UserActivityDetector implementation: | |
| 50 virtual void OnUserActivity(const ui::Event* event) OVERRIDE; | |
| 51 | |
| 52 static void FillUserDictionary(User* user, | |
| 53 bool is_owner, | |
| 54 bool is_signin_to_add, | |
| 55 LoginDisplay::AuthType auth_type, | |
| 56 base::DictionaryValue* user_dict); | |
| 57 static bool ShouldForceOnlineSignIn(const User* user); | |
| 58 | |
| 36 private: | 59 private: |
| 37 LoginDisplayWebUIHandler* handler_; | 60 LoginDisplayWebUIHandler* handler_; |
| 38 | 61 |
| 39 // Set of Users that are visible. | 62 // Set of Users that are visible. |
| 40 UserList users_; | 63 UserList users_; |
| 41 | 64 |
| 65 bool show_guest_; | |
|
Nikita (slow)
2014/05/23 15:52:15
nit: Copy comment as well.
Denis Kuznetsov (DE-MUC)
2014/05/27 17:35:28
Done.
| |
| 66 | |
| 67 // Map of callbacks run when the custom button on a user pod is clicked. | |
| 68 std::map<std::string, base::Closure> user_pod_button_callback_map_; | |
| 69 | |
| 70 // Map of usernames to their current authentication type. If a user is not | |
| 71 // contained in the map, it is using the default authentication type. | |
| 72 std::map<std::string, LoginDisplay::AuthType> user_auth_type_map_; | |
| 73 | |
| 74 // Timer for measuring idle state duration before password clear. | |
| 75 base::OneShotTimer<UserSelectionScreen> password_clear_timer_; | |
| 76 | |
| 42 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); | 77 DISALLOW_COPY_AND_ASSIGN(UserSelectionScreen); |
| 43 }; | 78 }; |
| 44 | 79 |
| 45 } // namespace chromeos | 80 } // namespace chromeos |
| 46 | 81 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_SELECTION_SCREEN_H_ |
| OLD | NEW |