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_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 6 #define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 } | 51 } |
52 | 52 |
53 namespace extensions { | 53 namespace extensions { |
54 class ExtensionRegistry; | 54 class ExtensionRegistry; |
55 } | 55 } |
56 | 56 |
57 namespace user_prefs { | 57 namespace user_prefs { |
58 class PrefRegistrySyncable; | 58 class PrefRegistrySyncable; |
59 } | 59 } |
60 | 60 |
| 61 namespace user_manager { |
| 62 class UserID; |
| 63 } |
| 64 |
61 // This class handles all the information related to a given supervised profile | 65 // This class handles all the information related to a given supervised profile |
62 // (e.g. the installed content packs, the default URL filtering behavior, or | 66 // (e.g. the installed content packs, the default URL filtering behavior, or |
63 // manual whitelist/blacklist overrides). | 67 // manual whitelist/blacklist overrides). |
64 class SupervisedUserService : public KeyedService, | 68 class SupervisedUserService : public KeyedService, |
65 #if defined(ENABLE_EXTENSIONS) | 69 #if defined(ENABLE_EXTENSIONS) |
66 public extensions::ManagementPolicy::Provider, | 70 public extensions::ManagementPolicy::Provider, |
67 #endif | 71 #endif |
68 public SyncTypePreferenceProvider, | 72 public SyncTypePreferenceProvider, |
69 public sync_driver::SyncServiceObserver, | 73 public sync_driver::SyncServiceObserver, |
70 public chrome::BrowserListObserver, | 74 public chrome::BrowserListObserver, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void InitSync(const std::string& refresh_token); | 141 void InitSync(const std::string& refresh_token); |
138 | 142 |
139 // Convenience method that registers this supervised user using | 143 // Convenience method that registers this supervised user using |
140 // |registration_utility| and initializes sync with the returned token. | 144 // |registration_utility| and initializes sync with the returned token. |
141 // The |callback| will be called when registration is complete, | 145 // The |callback| will be called when registration is complete, |
142 // whether it succeeded or not -- unless registration was cancelled manually, | 146 // whether it succeeded or not -- unless registration was cancelled manually, |
143 // in which case the callback will be ignored. | 147 // in which case the callback will be ignored. |
144 void RegisterAndInitSync( | 148 void RegisterAndInitSync( |
145 SupervisedUserRegistrationUtility* registration_utility, | 149 SupervisedUserRegistrationUtility* registration_utility, |
146 Profile* custodian_profile, | 150 Profile* custodian_profile, |
147 const std::string& supervised_user_id, | 151 const user_manager::UserID& supervised_user_id, |
148 const AuthErrorCallback& callback); | 152 const AuthErrorCallback& callback); |
149 | 153 |
150 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback); | 154 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback); |
151 void DidBlockNavigation(content::WebContents* web_contents); | 155 void DidBlockNavigation(content::WebContents* web_contents); |
152 | 156 |
153 void AddObserver(SupervisedUserServiceObserver* observer); | 157 void AddObserver(SupervisedUserServiceObserver* observer); |
154 void RemoveObserver(SupervisedUserServiceObserver* observer); | 158 void RemoveObserver(SupervisedUserServiceObserver* observer); |
155 | 159 |
156 void AddPermissionRequestCreator( | 160 void AddPermissionRequestCreator( |
157 scoped_ptr<PermissionRequestCreator> creator); | 161 scoped_ptr<PermissionRequestCreator> creator); |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 354 |
351 // Used to create permission requests. | 355 // Used to create permission requests. |
352 ScopedVector<PermissionRequestCreator> permissions_creators_; | 356 ScopedVector<PermissionRequestCreator> permissions_creators_; |
353 | 357 |
354 ObserverList<SupervisedUserServiceObserver> observer_list_; | 358 ObserverList<SupervisedUserServiceObserver> observer_list_; |
355 | 359 |
356 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 360 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
357 }; | 361 }; |
358 | 362 |
359 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 363 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |