| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/scoped_vector.h" | 18 #include "base/memory/scoped_vector.h" |
| 19 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 20 #include "base/scoped_observer.h" | 20 #include "base/scoped_observer.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "chrome/browser/net/file_downloader.h" |
| 23 #include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.
h" | 24 #include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.
h" |
| 24 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" | 25 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" |
| 25 #include "chrome/browser/supervised_user/supervised_users.h" | 26 #include "chrome/browser/supervised_user/supervised_users.h" |
| 26 #include "chrome/browser/ui/browser_list_observer.h" | 27 #include "chrome/browser/ui/browser_list_observer.h" |
| 27 #include "components/keyed_service/core/keyed_service.h" | 28 #include "components/keyed_service/core/keyed_service.h" |
| 28 #include "components/prefs/pref_change_registrar.h" | 29 #include "components/prefs/pref_change_registrar.h" |
| 29 #include "components/sync_driver/sync_service_observer.h" | 30 #include "components/sync_driver/sync_service_observer.h" |
| 30 #include "components/sync_driver/sync_type_preference_provider.h" | 31 #include "components/sync_driver/sync_type_preference_provider.h" |
| 31 #include "net/url_request/url_request_context_getter.h" | 32 #include "net/url_request/url_request_context_getter.h" |
| 32 | 33 |
| 33 #if defined(ENABLE_EXTENSIONS) | 34 #if defined(ENABLE_EXTENSIONS) |
| 34 #include "extensions/browser/management_policy.h" | 35 #include "extensions/browser/management_policy.h" |
| 35 #endif | 36 #endif |
| 36 | 37 |
| 37 class Browser; | 38 class Browser; |
| 38 class FileDownloader; | |
| 39 class GoogleServiceAuthError; | 39 class GoogleServiceAuthError; |
| 40 class PermissionRequestCreator; | 40 class PermissionRequestCreator; |
| 41 class Profile; | 41 class Profile; |
| 42 class SupervisedUserRegistrationUtility; | 42 class SupervisedUserRegistrationUtility; |
| 43 class SupervisedUserServiceObserver; | 43 class SupervisedUserServiceObserver; |
| 44 class SupervisedUserSettingsService; | 44 class SupervisedUserSettingsService; |
| 45 class SupervisedUserSiteList; | 45 class SupervisedUserSiteList; |
| 46 class SupervisedUserURLFilter; | 46 class SupervisedUserURLFilter; |
| 47 class SupervisedUserWhitelistService; | 47 class SupervisedUserWhitelistService; |
| 48 | 48 |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 void LoadBlacklist(const base::FilePath& path, const GURL& url); | 322 void LoadBlacklist(const base::FilePath& path, const GURL& url); |
| 323 | 323 |
| 324 void OnBlacklistFileChecked(const base::FilePath& path, | 324 void OnBlacklistFileChecked(const base::FilePath& path, |
| 325 const GURL& url, | 325 const GURL& url, |
| 326 bool file_exists); | 326 bool file_exists); |
| 327 | 327 |
| 328 // Asynchronously loads a blacklist from a binary file at |path| and applies | 328 // Asynchronously loads a blacklist from a binary file at |path| and applies |
| 329 // it to the URL filters. | 329 // it to the URL filters. |
| 330 void LoadBlacklistFromFile(const base::FilePath& path); | 330 void LoadBlacklistFromFile(const base::FilePath& path); |
| 331 | 331 |
| 332 void OnBlacklistDownloadDone(const base::FilePath& path, bool success); | 332 void OnBlacklistDownloadDone(const base::FilePath& path, |
| 333 FileDownloader::Result result); |
| 333 | 334 |
| 334 void OnBlacklistLoaded(); | 335 void OnBlacklistLoaded(); |
| 335 | 336 |
| 336 void UpdateBlacklist(); | 337 void UpdateBlacklist(); |
| 337 | 338 |
| 338 // Updates the manual overrides for hosts in the URL filters when the | 339 // Updates the manual overrides for hosts in the URL filters when the |
| 339 // corresponding preference is changed. | 340 // corresponding preference is changed. |
| 340 void UpdateManualHosts(); | 341 void UpdateManualHosts(); |
| 341 | 342 |
| 342 // Updates the manual overrides for URLs in the URL filters when the | 343 // Updates the manual overrides for URLs in the URL filters when the |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 | 398 |
| 398 // Used to create permission requests. | 399 // Used to create permission requests. |
| 399 ScopedVector<PermissionRequestCreator> permissions_creators_; | 400 ScopedVector<PermissionRequestCreator> permissions_creators_; |
| 400 | 401 |
| 401 base::ObserverList<SupervisedUserServiceObserver> observer_list_; | 402 base::ObserverList<SupervisedUserServiceObserver> observer_list_; |
| 402 | 403 |
| 403 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; | 404 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_; |
| 404 }; | 405 }; |
| 405 | 406 |
| 406 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ | 407 #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_ |
| OLD | NEW |