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 // Returns the path to a blacklist file to load, or an empty path to | 84 // Returns the path to a blacklist file to load, or an empty path to |
85 // indicate "none". | 85 // indicate "none". |
86 virtual base::FilePath GetBlacklistPath() const; | 86 virtual base::FilePath GetBlacklistPath() const; |
87 // Returns the URL from which to download a blacklist if no local one exists | 87 // Returns the URL from which to download a blacklist if no local one exists |
88 // yet. The blacklist file will be stored at |GetBlacklistPath()|. | 88 // yet. The blacklist file will be stored at |GetBlacklistPath()|. |
89 virtual GURL GetBlacklistURL() const; | 89 virtual GURL GetBlacklistURL() const; |
90 // Returns the identifier ("cx") of the Custom Search Engine to use for the | 90 // Returns the identifier ("cx") of the Custom Search Engine to use for the |
91 // experimental "SafeSites" feature, or the empty string to disable the | 91 // experimental "SafeSites" feature, or the empty string to disable the |
92 // feature. | 92 // feature. |
93 virtual std::string GetSafeSitesCx() const; | 93 virtual std::string GetSafeSitesCx() const; |
94 // Returns a custom Google API key to use for SafeSites, or the empty string | 94 // TODO(treib): Unused, remove this! |
95 // to use the default one. | |
96 virtual std::string GetSafeSitesApiKey() const; | 95 virtual std::string GetSafeSitesApiKey() const; |
Marc Treib
2014/11/13 17:45:40
I'll remove this after removing the downstream imp
| |
97 }; | 96 }; |
98 | 97 |
99 ~SupervisedUserService() override; | 98 ~SupervisedUserService() override; |
100 | 99 |
101 // ProfileKeyedService override: | 100 // ProfileKeyedService override: |
102 void Shutdown() override; | 101 void Shutdown() override; |
103 | 102 |
104 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 103 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
105 | 104 |
106 void SetDelegate(Delegate* delegate); | 105 void SetDelegate(Delegate* delegate); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 SupervisedUserURLFilter* io_url_filter() const; | 222 SupervisedUserURLFilter* io_url_filter() const; |
224 | 223 |
225 void SetDefaultFilteringBehavior( | 224 void SetDefaultFilteringBehavior( |
226 SupervisedUserURLFilter::FilteringBehavior behavior); | 225 SupervisedUserURLFilter::FilteringBehavior behavior); |
227 void LoadWhitelists(ScopedVector<SupervisedUserSiteList> site_lists); | 226 void LoadWhitelists(ScopedVector<SupervisedUserSiteList> site_lists); |
228 void LoadBlacklist(const base::FilePath& path); | 227 void LoadBlacklist(const base::FilePath& path); |
229 void SetManualHosts(scoped_ptr<std::map<std::string, bool> > host_map); | 228 void SetManualHosts(scoped_ptr<std::map<std::string, bool> > host_map); |
230 void SetManualURLs(scoped_ptr<std::map<GURL, bool> > url_map); | 229 void SetManualURLs(scoped_ptr<std::map<GURL, bool> > url_map); |
231 | 230 |
232 void InitAsyncURLChecker(net::URLRequestContextGetter* context, | 231 void InitAsyncURLChecker(net::URLRequestContextGetter* context, |
233 const std::string& cx, | 232 const std::string& cx); |
234 const std::string& api_key); | |
235 | 233 |
236 private: | 234 private: |
237 void OnBlacklistLoaded(); | 235 void OnBlacklistLoaded(); |
238 | 236 |
239 // SupervisedUserURLFilter is refcounted because the IO thread filter is | 237 // SupervisedUserURLFilter is refcounted because the IO thread filter is |
240 // used both by ProfileImplIOData and OffTheRecordProfileIOData (to filter | 238 // used both by ProfileImplIOData and OffTheRecordProfileIOData (to filter |
241 // network requests), so they both keep a reference to it. | 239 // network requests), so they both keep a reference to it. |
242 // Clients should not keep references to the UI thread filter, however | 240 // Clients should not keep references to the UI thread filter, however |
243 // (the filter will live as long as the profile lives, and afterwards it | 241 // (the filter will live as long as the profile lives, and afterwards it |
244 // should not be used anymore either). | 242 // should not be used anymore either). |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
374 | 372 |
375 // Used to create permission requests. | 373 // Used to create permission requests. |
376 ScopedVector<PermissionRequestCreator> permissions_creators_; | 374 ScopedVector<PermissionRequestCreator> permissions_creators_; |
377 | 375 |
378 ObserverList<SupervisedUserServiceObserver> observer_list_; | 376 ObserverList<SupervisedUserServiceObserver> observer_list_; |
379 | 377 |
380 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 378 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
381 }; | 379 }; |
382 | 380 |
383 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 381 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |