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 // TODO(treib): Unused, remove this! | 94 // Returns a custom Google API key to use for SafeSites, or the empty string |
| 95 // to use the default one. |
95 virtual std::string GetSafeSitesApiKey() const; | 96 virtual std::string GetSafeSitesApiKey() const; |
96 }; | 97 }; |
97 | 98 |
98 ~SupervisedUserService() override; | 99 ~SupervisedUserService() override; |
99 | 100 |
100 // ProfileKeyedService override: | 101 // ProfileKeyedService override: |
101 void Shutdown() override; | 102 void Shutdown() override; |
102 | 103 |
103 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 104 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
104 | 105 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 SupervisedUserURLFilter* io_url_filter() const; | 223 SupervisedUserURLFilter* io_url_filter() const; |
223 | 224 |
224 void SetDefaultFilteringBehavior( | 225 void SetDefaultFilteringBehavior( |
225 SupervisedUserURLFilter::FilteringBehavior behavior); | 226 SupervisedUserURLFilter::FilteringBehavior behavior); |
226 void LoadWhitelists(ScopedVector<SupervisedUserSiteList> site_lists); | 227 void LoadWhitelists(ScopedVector<SupervisedUserSiteList> site_lists); |
227 void LoadBlacklist(const base::FilePath& path); | 228 void LoadBlacklist(const base::FilePath& path); |
228 void SetManualHosts(scoped_ptr<std::map<std::string, bool> > host_map); | 229 void SetManualHosts(scoped_ptr<std::map<std::string, bool> > host_map); |
229 void SetManualURLs(scoped_ptr<std::map<GURL, bool> > url_map); | 230 void SetManualURLs(scoped_ptr<std::map<GURL, bool> > url_map); |
230 | 231 |
231 void InitAsyncURLChecker(net::URLRequestContextGetter* context, | 232 void InitAsyncURLChecker(net::URLRequestContextGetter* context, |
232 const std::string& cx); | 233 const std::string& cx, |
| 234 const std::string& api_key); |
233 | 235 |
234 private: | 236 private: |
235 void OnBlacklistLoaded(); | 237 void OnBlacklistLoaded(); |
236 | 238 |
237 // SupervisedUserURLFilter is refcounted because the IO thread filter is | 239 // SupervisedUserURLFilter is refcounted because the IO thread filter is |
238 // used both by ProfileImplIOData and OffTheRecordProfileIOData (to filter | 240 // used both by ProfileImplIOData and OffTheRecordProfileIOData (to filter |
239 // network requests), so they both keep a reference to it. | 241 // network requests), so they both keep a reference to it. |
240 // Clients should not keep references to the UI thread filter, however | 242 // Clients should not keep references to the UI thread filter, however |
241 // (the filter will live as long as the profile lives, and afterwards it | 243 // (the filter will live as long as the profile lives, and afterwards it |
242 // should not be used anymore either). | 244 // should not be used anymore either). |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 | 374 |
373 // Used to create permission requests. | 375 // Used to create permission requests. |
374 ScopedVector<PermissionRequestCreator> permissions_creators_; | 376 ScopedVector<PermissionRequestCreator> permissions_creators_; |
375 | 377 |
376 ObserverList<SupervisedUserServiceObserver> observer_list_; | 378 ObserverList<SupervisedUserServiceObserver> observer_list_; |
377 | 379 |
378 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 380 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
379 }; | 381 }; |
380 | 382 |
381 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 383 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
OLD | NEW |