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_USERS_SUPERVISED_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SUPERVISED_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SUPERVISED_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SUPERVISED_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual ~SupervisedUserManager() {} | 51 virtual ~SupervisedUserManager() {} |
52 | 52 |
53 // Checks if given user have supervised users on this device. | 53 // Checks if given user have supervised users on this device. |
54 | 54 |
55 virtual bool HasSupervisedUsers(const std::string& manager_id) const = 0; | 55 virtual bool HasSupervisedUsers(const std::string& manager_id) const = 0; |
56 | 56 |
57 // Creates supervised user with given |display_name| and |local_user_id| | 57 // Creates supervised user with given |display_name| and |local_user_id| |
58 // and persists that to user list. Also links this user identified by | 58 // and persists that to user list. Also links this user identified by |
59 // |sync_user_id| to manager with a |manager_id|. | 59 // |sync_user_id| to manager with a |manager_id|. |
60 // Returns created user, or existing user if there already | 60 // Returns created user, or existing user if there already |
61 // was locally managed user with such display name. | 61 // was a supervised user with such display name. |
62 // TODO(antrim): Refactor into a single struct to have only 1 getter. | 62 // TODO(antrim): Refactor into a single struct to have only 1 getter. |
63 virtual const User* CreateUserRecord( | 63 virtual const User* CreateUserRecord( |
64 const std::string& manager_id, | 64 const std::string& manager_id, |
65 const std::string& local_user_id, | 65 const std::string& local_user_id, |
66 const std::string& sync_user_id, | 66 const std::string& sync_user_id, |
67 const base::string16& display_name) = 0; | 67 const base::string16& display_name) = 0; |
68 | 68 |
69 // Generates unique user ID for supervised user. | 69 // Generates unique user ID for supervised user. |
70 virtual std::string GenerateUserId() = 0; | 70 virtual std::string GenerateUserId() = 0; |
71 | 71 |
(...skipping 26 matching lines...) Expand all Loading... |
98 // Otherwise, returns an empty string. | 98 // Otherwise, returns an empty string. |
99 virtual std::string GetManagerDisplayEmail(const std::string& user_id) | 99 virtual std::string GetManagerDisplayEmail(const std::string& user_id) |
100 const = 0; | 100 const = 0; |
101 | 101 |
102 // Create a record about starting supervised user creation transaction. | 102 // Create a record about starting supervised user creation transaction. |
103 virtual void StartCreationTransaction(const base::string16& display_name) = 0; | 103 virtual void StartCreationTransaction(const base::string16& display_name) = 0; |
104 | 104 |
105 // Add user id to supervised user creation transaction record. | 105 // Add user id to supervised user creation transaction record. |
106 virtual void SetCreationTransactionUserId(const std::string& user_id) = 0; | 106 virtual void SetCreationTransactionUserId(const std::string& user_id) = 0; |
107 | 107 |
108 // Remove locally managed user creation transaction record. | 108 // Remove supervised user creation transaction record. |
109 virtual void CommitCreationTransaction() = 0; | 109 virtual void CommitCreationTransaction() = 0; |
110 | 110 |
111 // Return object that handles specifics of supervised user authentication. | 111 // Return object that handles specifics of supervised user authentication. |
112 virtual SupervisedUserAuthentication* GetAuthentication() = 0; | 112 virtual SupervisedUserAuthentication* GetAuthentication() = 0; |
113 | 113 |
114 // Fill |result| with public password-specific data for |user_id| from Local | 114 // Fill |result| with public password-specific data for |user_id| from Local |
115 // State. | 115 // State. |
116 virtual void GetPasswordInformation(const std::string& user_id, | 116 virtual void GetPasswordInformation(const std::string& user_id, |
117 base::DictionaryValue* result) = 0; | 117 base::DictionaryValue* result) = 0; |
118 | 118 |
(...skipping 11 matching lines...) Expand all Loading... |
130 virtual void ConfigureSyncWithToken(Profile* profile, | 130 virtual void ConfigureSyncWithToken(Profile* profile, |
131 const std::string& token) = 0; | 131 const std::string& token) = 0; |
132 | 132 |
133 private: | 133 private: |
134 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManager); | 134 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManager); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace chromeos | 137 } // namespace chromeos |
138 | 138 |
139 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SUPERVISED_USER_MANAGER_H_ | 139 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_USERS_SUPERVISED_USER_MANAGER_H_ |
OLD | NEW |