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 COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ | 5 #ifndef COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ |
6 #define COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ | 6 #define COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 const std::string& username_hash, | 37 const std::string& username_hash, |
38 bool browser_restart) override; | 38 bool browser_restart) override; |
39 | 39 |
40 const user_manager::User* GetActiveUser() const override; | 40 const user_manager::User* GetActiveUser() const override; |
41 user_manager::User* GetActiveUser() override; | 41 user_manager::User* GetActiveUser() override; |
42 void SwitchActiveUser(const std::string& email) override; | 42 void SwitchActiveUser(const std::string& email) override; |
43 void SaveUserDisplayName(const std::string& username, | 43 void SaveUserDisplayName(const std::string& username, |
44 const base::string16& display_name) override; | 44 const base::string16& display_name) override; |
45 | 45 |
46 // Not implemented. | 46 // Not implemented. |
47 void UpdateUserAccountData(const std::string& user_id, | 47 void UpdateUserAccountData(const UserID& user_id, |
48 const UserAccountData& account_data) override {} | 48 const UserAccountData& account_data) override {} |
49 void Shutdown() override {} | 49 void Shutdown() override {} |
50 const user_manager::UserList& GetLRULoggedInUsers() const override; | 50 const user_manager::UserList& GetLRULoggedInUsers() const override; |
51 user_manager::UserList GetUnlockUsers() const override; | 51 user_manager::UserList GetUnlockUsers() const override; |
52 const std::string& GetOwnerEmail() const override; | 52 const std::string& GetOwnerEmail() const override; |
53 void SessionStarted() override {} | 53 void SessionStarted() override {} |
54 void RemoveUser(const std::string& email, | 54 void RemoveUser(const std::string& email, |
55 user_manager::RemoveUserDelegate* delegate) override {} | 55 user_manager::RemoveUserDelegate* delegate) override {} |
56 void RemoveUserFromList(const std::string& email) override; | 56 void RemoveUserFromList(const std::string& email) override; |
57 bool IsKnownUser(const std::string& email) const override; | 57 bool IsKnownUser(const std::string& email) const override; |
58 const user_manager::User* FindUser(const std::string& email) const override; | 58 const user_manager::User* FindUser(const std::string& email) const override; |
59 user_manager::User* FindUserAndModify(const std::string& email) override; | 59 user_manager::User* FindUserAndModify(const std::string& email) override; |
60 const user_manager::User* GetLoggedInUser() const override; | 60 const user_manager::User* GetLoggedInUser() const override; |
61 user_manager::User* GetLoggedInUser() override; | 61 user_manager::User* GetLoggedInUser() override; |
62 const user_manager::User* GetPrimaryUser() const override; | 62 const user_manager::User* GetPrimaryUser() const override; |
63 void SaveUserOAuthStatus( | 63 void SaveUserOAuthStatus( |
64 const std::string& username, | 64 const std::string& username, |
65 user_manager::User::OAuthTokenStatus oauth_token_status) override {} | 65 user_manager::User::OAuthTokenStatus oauth_token_status) override {} |
66 void SaveForceOnlineSignin(const std::string& user_id, | 66 void SaveForceOnlineSignin(const UserID& user_id, |
67 bool force_online_signin) override {} | 67 bool force_online_signin) override {} |
68 base::string16 GetUserDisplayName(const std::string& username) const override; | 68 base::string16 GetUserDisplayName(const std::string& username) const override; |
69 void SaveUserDisplayEmail(const std::string& username, | 69 void SaveUserDisplayEmail(const std::string& username, |
70 const std::string& display_email) override {} | 70 const std::string& display_email) override {} |
71 std::string GetUserDisplayEmail(const std::string& username) const override; | 71 std::string GetUserDisplayEmail(const std::string& username) const override; |
72 bool IsCurrentUserOwner() const override; | 72 bool IsCurrentUserOwner() const override; |
73 bool IsCurrentUserNew() const override; | 73 bool IsCurrentUserNew() const override; |
74 bool IsCurrentUserNonCryptohomeDataEphemeral() const override; | 74 bool IsCurrentUserNonCryptohomeDataEphemeral() const override; |
75 bool CanCurrentUserLock() const override; | 75 bool CanCurrentUserLock() const override; |
76 bool IsUserLoggedIn() const override; | 76 bool IsUserLoggedIn() const override; |
(...skipping 11 matching lines...) Expand all Loading... |
88 void AddSessionStateObserver(UserSessionStateObserver* obs) override {} | 88 void AddSessionStateObserver(UserSessionStateObserver* obs) override {} |
89 void RemoveSessionStateObserver(UserSessionStateObserver* obs) override {} | 89 void RemoveSessionStateObserver(UserSessionStateObserver* obs) override {} |
90 void NotifyLocalStateChanged() override {} | 90 void NotifyLocalStateChanged() override {} |
91 bool AreSupervisedUsersAllowed() const override; | 91 bool AreSupervisedUsersAllowed() const override; |
92 | 92 |
93 // UserManagerBase overrides: | 93 // UserManagerBase overrides: |
94 bool AreEphemeralUsersEnabled() const override; | 94 bool AreEphemeralUsersEnabled() const override; |
95 const std::string& GetApplicationLocale() const override; | 95 const std::string& GetApplicationLocale() const override; |
96 PrefService* GetLocalState() const override; | 96 PrefService* GetLocalState() const override; |
97 void HandleUserOAuthTokenStatusChange( | 97 void HandleUserOAuthTokenStatusChange( |
98 const std::string& user_id, | 98 const UserID& user_id, |
99 user_manager::User::OAuthTokenStatus status) const override {} | 99 user_manager::User::OAuthTokenStatus status) const override {} |
100 bool IsEnterpriseManaged() const override; | 100 bool IsEnterpriseManaged() const override; |
101 void LoadPublicAccounts(std::set<std::string>* public_sessions_set) override { | 101 void LoadPublicAccounts(std::set<std::string>* public_sessions_set) override { |
102 } | 102 } |
103 void PerformPreUserListLoadingActions() override {} | 103 void PerformPreUserListLoadingActions() override {} |
104 void PerformPostUserListLoadingActions() override {} | 104 void PerformPostUserListLoadingActions() override {} |
105 void PerformPostUserLoggedInActions(bool browser_restart) override {} | 105 void PerformPostUserLoggedInActions(bool browser_restart) override {} |
106 bool IsDemoApp(const std::string& user_id) const override; | 106 bool IsDemoApp(const UserID& user_id) const override; |
107 bool IsKioskApp(const std::string& user_id) const override; | 107 bool IsKioskApp(const UserID& user_id) const override; |
108 bool IsPublicAccountMarkedForRemoval( | 108 bool IsPublicAccountMarkedForRemoval( |
109 const std::string& user_id) const override; | 109 const UserID& user_id) const override; |
110 void DemoAccountLoggedIn() override {} | 110 void DemoAccountLoggedIn() override {} |
111 void KioskAppLoggedIn(const std::string& app_id) override {} | 111 void KioskAppLoggedIn(const std::string& app_id) override {} |
112 void PublicAccountUserLoggedIn(user_manager::User* user) override {} | 112 void PublicAccountUserLoggedIn(user_manager::User* user) override {} |
113 void SupervisedUserLoggedIn(const std::string& user_id) override {} | 113 void SupervisedUserLoggedIn(const UserID& user_id) override {} |
114 | 114 |
115 protected: | 115 protected: |
116 user_manager::User* primary_user_; | 116 user_manager::User* primary_user_; |
117 | 117 |
118 // If set this is the active user. If empty, the first created user is the | 118 // If set this is the active user. If empty, the first created user is the |
119 // active user. | 119 // active user. |
120 std::string active_user_id_; | 120 UserID active_user_id_; |
121 | 121 |
122 private: | 122 private: |
123 // We use this internal function for const-correctness. | 123 // We use this internal function for const-correctness. |
124 user_manager::User* GetActiveUserInternal() const; | 124 user_manager::User* GetActiveUserInternal() const; |
125 | 125 |
126 // stub, always empty string. | 126 // stub, always empty string. |
127 std::string owner_email_; | 127 std::string owner_email_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(FakeUserManager); | 129 DISALLOW_COPY_AND_ASSIGN(FakeUserManager); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace user_manager | 132 } // namespace user_manager |
133 | 133 |
134 #endif // COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ | 134 #endif // COMPONENTS_USER_MANAGER_FAKE_USER_MANAGER_H_ |
OLD | NEW |