| Index: components/user_manager/fake_user_manager.h
|
| diff --git a/components/user_manager/fake_user_manager.h b/components/user_manager/fake_user_manager.h
|
| index 77f1649f45c689424c85e13b605cfdaaf4ad71c3..a40eed6e800818d468aff2d7e88e3b4ae1f2f41e 100644
|
| --- a/components/user_manager/fake_user_manager.h
|
| +++ b/components/user_manager/fake_user_manager.h
|
| @@ -9,7 +9,6 @@
|
| #include <string>
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| -#include "components/signin/core/account_id/account_id.h"
|
| #include "components/user_manager/user.h"
|
| #include "components/user_manager/user_manager_base.h"
|
|
|
| @@ -24,16 +23,15 @@
|
|
|
| // Create and add a new user. Created user is not affiliated with the domain,
|
| // that owns the device.
|
| - virtual const user_manager::User* AddUser(const AccountId& account_id);
|
| + virtual const user_manager::User* AddUser(const std::string& email);
|
|
|
| // The same as AddUser() but allows to specify user affiliation with the
|
| // domain, that owns the device.
|
| virtual const user_manager::User* AddUserWithAffiliation(
|
| - const AccountId& account_id,
|
| - bool is_affiliated);
|
| + const std::string& email, bool is_affiliated);
|
|
|
| // Calculates the user name hash and calls UserLoggedIn to login a user.
|
| - void LoginUser(const AccountId& account_id);
|
| + void LoginUser(const std::string& email);
|
|
|
| // UserManager overrides.
|
| const user_manager::UserList& GetUsers() const override;
|
| @@ -41,43 +39,42 @@
|
| const user_manager::UserList& GetLoggedInUsers() const override;
|
|
|
| // Set the user as logged in.
|
| - void UserLoggedIn(const AccountId& account_id,
|
| + void UserLoggedIn(const std::string& email,
|
| const std::string& username_hash,
|
| bool browser_restart) override;
|
|
|
| const user_manager::User* GetActiveUser() const override;
|
| user_manager::User* GetActiveUser() override;
|
| - void SwitchActiveUser(const AccountId& account_id) override;
|
| - void SaveUserDisplayName(const AccountId& account_id,
|
| + void SwitchActiveUser(const std::string& email) override;
|
| + void SaveUserDisplayName(const std::string& username,
|
| const base::string16& display_name) override;
|
|
|
| // Not implemented.
|
| - void UpdateUserAccountData(const AccountId& account_id,
|
| + void UpdateUserAccountData(const std::string& user_id,
|
| const UserAccountData& account_data) override {}
|
| void Shutdown() override {}
|
| const user_manager::UserList& GetLRULoggedInUsers() const override;
|
| user_manager::UserList GetUnlockUsers() const override;
|
| - const AccountId& GetOwnerAccountId() const override;
|
| + const std::string& GetOwnerEmail() const override;
|
| void SessionStarted() override {}
|
| - void RemoveUser(const AccountId& account_id,
|
| + void RemoveUser(const std::string& email,
|
| user_manager::RemoveUserDelegate* delegate) override {}
|
| - void RemoveUserFromList(const AccountId& account_id) override;
|
| - bool IsKnownUser(const AccountId& account_id) const override;
|
| - const user_manager::User* FindUser(
|
| - const AccountId& account_id) const override;
|
| - user_manager::User* FindUserAndModify(const AccountId& account_id) override;
|
| + void RemoveUserFromList(const std::string& email) override;
|
| + bool IsKnownUser(const std::string& email) const override;
|
| + const user_manager::User* FindUser(const std::string& email) const override;
|
| + user_manager::User* FindUserAndModify(const std::string& email) override;
|
| const user_manager::User* GetLoggedInUser() const override;
|
| user_manager::User* GetLoggedInUser() override;
|
| const user_manager::User* GetPrimaryUser() const override;
|
| void SaveUserOAuthStatus(
|
| - const AccountId& account_id,
|
| + const std::string& username,
|
| user_manager::User::OAuthTokenStatus oauth_token_status) override {}
|
| - void SaveForceOnlineSignin(const AccountId& account_id,
|
| + void SaveForceOnlineSignin(const std::string& user_id,
|
| bool force_online_signin) override {}
|
| - base::string16 GetUserDisplayName(const AccountId& account_id) const override;
|
| - void SaveUserDisplayEmail(const AccountId& account_id,
|
| + base::string16 GetUserDisplayName(const std::string& username) const override;
|
| + void SaveUserDisplayEmail(const std::string& username,
|
| const std::string& display_email) override {}
|
| - std::string GetUserDisplayEmail(const AccountId& account_id) const override;
|
| + std::string GetUserDisplayEmail(const std::string& username) const override;
|
| bool IsCurrentUserOwner() const override;
|
| bool IsCurrentUserNew() const override;
|
| bool IsCurrentUserNonCryptohomeDataEphemeral() const override;
|
| @@ -91,7 +88,7 @@
|
| bool IsLoggedInAsStub() const override;
|
| bool IsSessionStarted() const override;
|
| bool IsUserNonCryptohomeDataEphemeral(
|
| - const AccountId& account_id) const override;
|
| + const std::string& email) const override;
|
| void AddObserver(Observer* obs) override {}
|
| void RemoveObserver(Observer* obs) override {}
|
| void AddSessionStateObserver(UserSessionStateObserver* obs) override {}
|
| @@ -104,36 +101,37 @@
|
| const std::string& GetApplicationLocale() const override;
|
| PrefService* GetLocalState() const override;
|
| void HandleUserOAuthTokenStatusChange(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| user_manager::User::OAuthTokenStatus status) const override {}
|
| bool IsEnterpriseManaged() const override;
|
| - void LoadPublicAccounts(std::set<AccountId>* public_sessions_set) override {}
|
| + void LoadPublicAccounts(std::set<std::string>* public_sessions_set) override {
|
| + }
|
| void PerformPreUserListLoadingActions() override {}
|
| void PerformPostUserListLoadingActions() override {}
|
| void PerformPostUserLoggedInActions(bool browser_restart) override {}
|
| - bool IsDemoApp(const AccountId& account_id) const override;
|
| - bool IsKioskApp(const AccountId& account_id) const override;
|
| + bool IsDemoApp(const std::string& user_id) const override;
|
| + bool IsKioskApp(const std::string& user_id) const override;
|
| bool IsPublicAccountMarkedForRemoval(
|
| - const AccountId& account_id) const override;
|
| + const std::string& user_id) const override;
|
| void DemoAccountLoggedIn() override {}
|
| - void KioskAppLoggedIn(const AccountId& kiosk_app_account_id) override {}
|
| + void KioskAppLoggedIn(const std::string& app_id) override {}
|
| void PublicAccountUserLoggedIn(user_manager::User* user) override {}
|
| - void SupervisedUserLoggedIn(const AccountId& account_id) override {}
|
| - void OnUserRemoved(const AccountId& account_id) override {}
|
| + void SupervisedUserLoggedIn(const std::string& user_id) override {}
|
| + void OnUserRemoved(const std::string& user_id) override {}
|
|
|
| protected:
|
| user_manager::User* primary_user_;
|
|
|
| // If set this is the active user. If empty, the first created user is the
|
| // active user.
|
| - AccountId active_account_id_ = EmptyAccountId();
|
| + std::string active_user_id_;
|
|
|
| private:
|
| // We use this internal function for const-correctness.
|
| user_manager::User* GetActiveUserInternal() const;
|
|
|
| - // stub, always empty.
|
| - AccountId owner_account_id_ = EmptyAccountId();
|
| + // stub, always empty string.
|
| + std::string owner_email_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(FakeUserManager);
|
| };
|
|
|