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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // false to indicate that the SupervisedUserService itself should handle it. | 84 // false to indicate that the SupervisedUserService itself should handle it. |
85 virtual bool SetActive(bool active) = 0; | 85 virtual bool SetActive(bool active) = 0; |
86 // Returns the path to a blacklist file to load, or an empty path to | 86 // Returns the path to a blacklist file to load, or an empty path to |
87 // indicate "none". | 87 // indicate "none". |
88 virtual base::FilePath GetBlacklistPath() const = 0; | 88 virtual base::FilePath GetBlacklistPath() const = 0; |
89 // Returns the URL from which to download a blacklist if no local one exists | 89 // Returns the URL from which to download a blacklist if no local one exists |
90 // yet. The blacklist file will be stored at |GetBlacklistPath()|. | 90 // yet. The blacklist file will be stored at |GetBlacklistPath()|. |
91 virtual GURL GetBlacklistURL() const = 0; | 91 virtual GURL GetBlacklistURL() const = 0; |
92 }; | 92 }; |
93 | 93 |
94 virtual ~SupervisedUserService(); | 94 ~SupervisedUserService() override; |
95 | 95 |
96 // ProfileKeyedService override: | 96 // ProfileKeyedService override: |
97 virtual void Shutdown() override; | 97 void Shutdown() override; |
98 | 98 |
99 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 99 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
100 | 100 |
101 void SetDelegate(Delegate* delegate); | 101 void SetDelegate(Delegate* delegate); |
102 | 102 |
103 // Returns the URL filter for the IO thread, for filtering network requests | 103 // Returns the URL filter for the IO thread, for filtering network requests |
104 // (in SupervisedUserResourceThrottle). | 104 // (in SupervisedUserResourceThrottle). |
105 scoped_refptr<const SupervisedUserURLFilter> GetURLFilterForIOThread(); | 105 scoped_refptr<const SupervisedUserURLFilter> GetURLFilterForIOThread(); |
106 | 106 |
107 // Returns the URL filter for the UI thread, for filtering navigations and | 107 // Returns the URL filter for the UI thread, for filtering navigations and |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 void DidBlockNavigation(content::WebContents* web_contents); | 172 void DidBlockNavigation(content::WebContents* web_contents); |
173 | 173 |
174 void AddObserver(SupervisedUserServiceObserver* observer); | 174 void AddObserver(SupervisedUserServiceObserver* observer); |
175 void RemoveObserver(SupervisedUserServiceObserver* observer); | 175 void RemoveObserver(SupervisedUserServiceObserver* observer); |
176 | 176 |
177 // Will take ownership of |creator|. | 177 // Will take ownership of |creator|. |
178 void AddPermissionRequestCreatorForTesting(PermissionRequestCreator* creator); | 178 void AddPermissionRequestCreatorForTesting(PermissionRequestCreator* creator); |
179 | 179 |
180 #if defined(ENABLE_EXTENSIONS) | 180 #if defined(ENABLE_EXTENSIONS) |
181 // extensions::ManagementPolicy::Provider implementation: | 181 // extensions::ManagementPolicy::Provider implementation: |
182 virtual std::string GetDebugPolicyProviderName() const override; | 182 std::string GetDebugPolicyProviderName() const override; |
183 virtual bool UserMayLoad(const extensions::Extension* extension, | 183 bool UserMayLoad(const extensions::Extension* extension, |
184 base::string16* error) const override; | 184 base::string16* error) const override; |
185 virtual bool UserMayModifySettings(const extensions::Extension* extension, | 185 bool UserMayModifySettings(const extensions::Extension* extension, |
186 base::string16* error) const override; | 186 base::string16* error) const override; |
187 | 187 |
188 // extensions::ExtensionRegistryObserver implementation. | 188 // extensions::ExtensionRegistryObserver implementation. |
189 virtual void OnExtensionLoaded( | 189 void OnExtensionLoaded(content::BrowserContext* browser_context, |
190 content::BrowserContext* browser_context, | 190 const extensions::Extension* extension) override; |
191 const extensions::Extension* extension) override; | 191 void OnExtensionUnloaded( |
192 virtual void OnExtensionUnloaded( | |
193 content::BrowserContext* browser_context, | 192 content::BrowserContext* browser_context, |
194 const extensions::Extension* extension, | 193 const extensions::Extension* extension, |
195 extensions::UnloadedExtensionInfo::Reason reason) override; | 194 extensions::UnloadedExtensionInfo::Reason reason) override; |
196 #endif | 195 #endif |
197 | 196 |
198 // SyncTypePreferenceProvider implementation: | 197 // SyncTypePreferenceProvider implementation: |
199 virtual syncer::ModelTypeSet GetPreferredDataTypes() const override; | 198 syncer::ModelTypeSet GetPreferredDataTypes() const override; |
200 | 199 |
201 // ProfileSyncServiceObserver implementation: | 200 // ProfileSyncServiceObserver implementation: |
202 virtual void OnStateChanged() override; | 201 void OnStateChanged() override; |
203 | 202 |
204 // chrome::BrowserListObserver implementation: | 203 // chrome::BrowserListObserver implementation: |
205 virtual void OnBrowserSetLastActive(Browser* browser) override; | 204 void OnBrowserSetLastActive(Browser* browser) override; |
206 | 205 |
207 private: | 206 private: |
208 friend class SupervisedUserServiceExtensionTestBase; | 207 friend class SupervisedUserServiceExtensionTestBase; |
209 friend class SupervisedUserServiceFactory; | 208 friend class SupervisedUserServiceFactory; |
210 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity); | 209 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity); |
211 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); | 210 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration); |
212 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, | 211 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
213 ChangesIncludedSessionOnChangedSettings); | 212 ChangesIncludedSessionOnChangedSettings); |
214 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, | 213 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, |
215 ChangesSyncSessionStateOnChangedSettings); | 214 ChangesSyncSessionStateOnChangedSettings); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 371 |
373 // Used to create permission requests. | 372 // Used to create permission requests. |
374 ScopedVector<PermissionRequestCreator> permissions_creators_; | 373 ScopedVector<PermissionRequestCreator> permissions_creators_; |
375 | 374 |
376 ObserverList<SupervisedUserServiceObserver> observer_list_; | 375 ObserverList<SupervisedUserServiceObserver> observer_list_; |
377 | 376 |
378 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 377 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
379 }; | 378 }; |
380 | 379 |
381 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 380 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |