Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: chrome/browser/chromeos/login/users/fake_supervised_user_manager.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_USERS_FAKE_SUPERVISED_USER_MANAGER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_SUPERVISED_USER_MANAGER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_SUPERVISED_USER_MANAGER_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_SUPERVISED_USER_MANAGER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" 10 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h"
11 11
12 namespace user_manager {
13 class UserID;
14 } // namespace user_manager
15
12 namespace chromeos { 16 namespace chromeos {
13 17
14 // Fake supervised user manager with a barebones implementation. 18 // Fake supervised user manager with a barebones implementation.
15 class FakeSupervisedUserManager : public SupervisedUserManager { 19 class FakeSupervisedUserManager : public SupervisedUserManager {
16 public: 20 public:
17 FakeSupervisedUserManager(); 21 FakeSupervisedUserManager();
18 ~FakeSupervisedUserManager() override; 22 ~FakeSupervisedUserManager() override;
19 23
20 bool HasSupervisedUsers(const std::string& manager_id) const override; 24 bool HasSupervisedUsers(const user_manager::UserID& manager_id) const override ;
21 const user_manager::User* CreateUserRecord( 25 const user_manager::User* CreateUserRecord(
22 const std::string& manager_id, 26 const user_manager::UserID& manager_id,
23 const std::string& local_user_id, 27 const user_manager::UserID& local_user_id,
24 const std::string& sync_user_id, 28 const std::string& sync_user_id,
25 const base::string16& display_name) override; 29 const base::string16& display_name) override;
26 std::string GenerateUserId() override; 30 std::string GenerateUserId() override;
27 const user_manager::User* FindByDisplayName( 31 const user_manager::User* FindByDisplayName(
28 const base::string16& display_name) const override; 32 const base::string16& display_name) const override;
29 const user_manager::User* FindBySyncId( 33 const user_manager::User* FindBySyncId(
30 const std::string& sync_id) const override; 34 const std::string& sync_id) const override;
31 std::string GetUserSyncId(const std::string& user_id) const override; 35 std::string GetUserSyncId(const user_manager::UserID& user_id) const override;
32 base::string16 GetManagerDisplayName( 36 base::string16 GetManagerDisplayName(
33 const std::string& user_id) const override; 37 const user_manager::UserID& user_id) const override;
34 std::string GetManagerUserId(const std::string& user_id) const override; 38 const user_manager::UserID& GetManagerUserId(const user_manager::UserID& user_ id) const override;
35 std::string GetManagerDisplayEmail(const std::string& user_id) const override; 39 std::string GetManagerDisplayEmail(const user_manager::UserID& user_id) const override;
36 void StartCreationTransaction(const base::string16& display_name) override {} 40 void StartCreationTransaction(const base::string16& display_name) override {}
37 void SetCreationTransactionUserId(const std::string& user_id) override {} 41 void SetCreationTransactionUserId(const user_manager::UserID& user_id) overrid e {}
38 void CommitCreationTransaction() override {} 42 void CommitCreationTransaction() override {}
39 SupervisedUserAuthentication* GetAuthentication() override; 43 SupervisedUserAuthentication* GetAuthentication() override;
40 void GetPasswordInformation(const std::string& user_id, 44 void GetPasswordInformation(const user_manager::UserID& user_id,
41 base::DictionaryValue* result) override {} 45 base::DictionaryValue* result) override {}
42 void SetPasswordInformation( 46 void SetPasswordInformation(
43 const std::string& user_id, 47 const user_manager::UserID& user_id,
44 const base::DictionaryValue* password_info) override {} 48 const base::DictionaryValue* password_info) override {}
45 void LoadSupervisedUserToken(Profile* profile, 49 void LoadSupervisedUserToken(Profile* profile,
46 const LoadTokenCallback& callback) override; 50 const LoadTokenCallback& callback) override;
47 void ConfigureSyncWithToken(Profile* profile, 51 void ConfigureSyncWithToken(Profile* profile,
48 const std::string& token) override {} 52 const std::string& token) override {}
49 53
50 private: 54 private:
51 DISALLOW_COPY_AND_ASSIGN(FakeSupervisedUserManager); 55 DISALLOW_COPY_AND_ASSIGN(FakeSupervisedUserManager);
52 }; 56 };
53 57
54 } // namespace chromeos 58 } // namespace chromeos
55 59
56 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_SUPERVISED_USER_MANAGER_H_ 60 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_FAKE_SUPERVISED_USER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698