OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SUPERVISED_USER_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" |
11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "chrome/browser/profiles/profile.h" |
13 | 15 |
14 class PrefRegistrySimple; | 16 class PrefRegistrySimple; |
15 | 17 |
16 namespace chromeos { | 18 namespace chromeos { |
17 | 19 |
18 class User; | 20 class User; |
19 class SupervisedUserAuthentication; | 21 class SupervisedUserAuthentication; |
20 | 22 |
21 // Keys in dictionary with supervised password information. | 23 // Keys in dictionary with supervised password information. |
22 extern const char kSchemaVersion[]; | 24 extern const char kSchemaVersion[]; |
23 extern const char kPasswordRevision[]; | 25 extern const char kPasswordRevision[]; |
24 extern const char kSalt[]; | 26 extern const char kSalt[]; |
25 extern const char kEncryptedPassword[]; | 27 extern const char kEncryptedPassword[]; |
26 extern const int kMinPasswordRevision; | 28 extern const int kMinPasswordRevision; |
27 | 29 |
28 // Base class for SupervisedUserManagerImpl - provides a mechanism for getting | 30 // Base class for SupervisedUserManagerImpl - provides a mechanism for getting |
29 // and setting specific values for supervised users, as well as additional | 31 // and setting specific values for supervised users, as well as additional |
30 // lookup methods that make sense only for supervised users. | 32 // lookup methods that make sense only for supervised users. |
31 class SupervisedUserManager { | 33 class SupervisedUserManager { |
32 public: | 34 public: |
| 35 typedef base::Callback<void(const std::string& /* token */)> |
| 36 LoadTokenCallback; |
| 37 |
33 // Registers user manager preferences. | 38 // Registers user manager preferences. |
34 static void RegisterPrefs(PrefRegistrySimple* registry); | 39 static void RegisterPrefs(PrefRegistrySimple* registry); |
35 | 40 |
36 SupervisedUserManager() {} | 41 SupervisedUserManager() {} |
37 virtual ~SupervisedUserManager() {} | 42 virtual ~SupervisedUserManager() {} |
38 | 43 |
39 // Creates supervised user with given |display_name| and |local_user_id| | 44 // Creates supervised user with given |display_name| and |local_user_id| |
40 // and persists that to user list. Also links this user identified by | 45 // and persists that to user list. Also links this user identified by |
41 // |sync_user_id| to manager with a |manager_id|. | 46 // |sync_user_id| to manager with a |manager_id|. |
42 // Returns created user, or existing user if there already | 47 // Returns created user, or existing user if there already |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // State. | 102 // State. |
98 virtual void GetPasswordInformation(const std::string& user_id, | 103 virtual void GetPasswordInformation(const std::string& user_id, |
99 base::DictionaryValue* result) = 0; | 104 base::DictionaryValue* result) = 0; |
100 | 105 |
101 // Stores public password-specific data from |password_info| for |user_id| in | 106 // Stores public password-specific data from |password_info| for |user_id| in |
102 // Local State. | 107 // Local State. |
103 virtual void SetPasswordInformation( | 108 virtual void SetPasswordInformation( |
104 const std::string& user_id, | 109 const std::string& user_id, |
105 const base::DictionaryValue* password_info) = 0; | 110 const base::DictionaryValue* password_info) = 0; |
106 | 111 |
| 112 // Loads a sync oauth token in background, and passes it to callback. |
| 113 virtual void LoadSupervisedUserToken(Profile* profile, |
| 114 const LoadTokenCallback& callback) = 0; |
| 115 |
| 116 // Configures sync service with oauth token. |
| 117 virtual void ConfigureSyncWithToken(Profile* profile, |
| 118 const std::string& token) = 0; |
| 119 |
107 private: | 120 private: |
108 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManager); | 121 DISALLOW_COPY_AND_ASSIGN(SupervisedUserManager); |
109 }; | 122 }; |
110 | 123 |
111 } // namespace chromeos | 124 } // namespace chromeos |
112 | 125 |
113 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_H_ | 126 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SUPERVISED_USER_MANAGER_H_ |
OLD | NEW |