blob: 353d58691d837463eca36ef467e02a60390319ec [file] [log] [blame]
[email protected]cce15bb2014-06-17 13:43:511// Copyright 2014 The Chromium Authors. All rights reserved.
[email protected]0850e842013-01-19 03:44:312// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]cce15bb2014-06-17 13:43:515#ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_
6#define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_
[email protected]0850e842013-01-19 03:44:317
avi664c07b2015-12-26 02:18:318#include <stddef.h>
9
treib950c6e82014-09-23 13:07:2910#include <map>
treib950c6e82014-09-23 13:07:2911#include <string>
[email protected]0850e842013-01-19 03:44:3112#include <vector>
13
[email protected]438f7e12013-08-07 06:59:0014#include "base/callback.h"
[email protected]076ebeda2014-06-06 21:47:2615#include "base/gtest_prod_util.h"
avi664c07b2015-12-26 02:18:3116#include "base/macros.h"
[email protected]a581ea22013-05-06 12:34:1917#include "base/memory/scoped_ptr.h"
thestig7790a352015-08-22 00:05:1118#include "base/memory/scoped_vector.h"
treibab0a39e2014-09-24 14:48:2819#include "base/observer_list.h"
[email protected]f2253ac2014-05-28 08:37:2120#include "base/scoped_observer.h"
[email protected]f9b294362013-06-10 20:22:3121#include "base/strings/string16.h"
avi664c07b2015-12-26 02:18:3122#include "build/build_config.h"
atanasovaac676032016-04-05 16:31:0523#include "chrome/browser/supervised_user/experimental/safe_search_url_reporter.h"
treib4edbded2014-09-05 08:43:5524#include "chrome/browser/supervised_user/experimental/supervised_user_blacklist.h"
[email protected]cce15bb2014-06-17 13:43:5125#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
26#include "chrome/browser/supervised_user/supervised_users.h"
[email protected]514fcf22013-08-13 06:37:2427#include "chrome/browser/ui/browser_list_observer.h"
[email protected]12b7af32014-03-13 05:28:2028#include "components/keyed_service/core/keyed_service.h"
brettwb1fc1b82016-02-02 00:19:0829#include "components/prefs/pref_change_registrar.h"
droger507e7e2f2015-04-03 18:56:2330#include "components/sync_driver/sync_service_observer.h"
blundell7282b512015-11-09 07:21:1131#include "components/sync_driver/sync_type_preference_provider.h"
maxbogue8e4fb452015-02-11 20:26:0932#include "net/url_request/url_request_context_getter.h"
[email protected]c14a6802014-07-11 21:51:1233
34#if defined(ENABLE_EXTENSIONS)
[email protected]301116c62013-11-26 10:37:4535#include "extensions/browser/management_policy.h"
[email protected]c14a6802014-07-11 21:51:1236#endif
[email protected]0850e842013-01-19 03:44:3137
[email protected]509ad1a92013-03-19 21:41:0638class Browser;
treibcffa6502015-08-06 09:12:2739class FileDownloader;
[email protected]acfcfbb2013-05-13 18:01:2740class GoogleServiceAuthError;
[email protected]4db65f952014-05-20 15:46:3041class PermissionRequestCreator;
[email protected]0850e842013-01-19 03:44:3142class Profile;
[email protected]cce15bb2014-06-17 13:43:5143class SupervisedUserRegistrationUtility;
treibab0a39e2014-09-24 14:48:2844class SupervisedUserServiceObserver;
[email protected]cce15bb2014-06-17 13:43:5145class SupervisedUserSettingsService;
46class SupervisedUserSiteList;
47class SupervisedUserURLFilter;
bauerb4da36132014-12-26 19:53:1348class SupervisedUserWhitelistService;
[email protected]0850e842013-01-19 03:44:3149
treibdaece84f2014-09-05 12:58:1550namespace base {
51class FilePath;
treibf832a992015-03-24 18:09:2452class Version;
treibdaece84f2014-09-05 12:58:1553}
54
treib565a0192014-12-04 13:17:3155namespace content {
56class WebContents;
57}
58
[email protected]f2253ac2014-05-28 08:37:2159namespace extensions {
60class ExtensionRegistry;
61}
62
[email protected]443e9312013-05-06 06:17:3463namespace user_prefs {
64class PrefRegistrySyncable;
65}
66
[email protected]cce15bb2014-06-17 13:43:5167// This class handles all the information related to a given supervised profile
[email protected]0850e842013-01-19 03:44:3168// (e.g. the installed content packs, the default URL filtering behavior, or
69// manual whitelist/blacklist overrides).
[email protected]cce15bb2014-06-17 13:43:5170class SupervisedUserService : public KeyedService,
[email protected]c14a6802014-07-11 21:51:1271#if defined(ENABLE_EXTENSIONS)
[email protected]cce15bb2014-06-17 13:43:5172 public extensions::ManagementPolicy::Provider,
[email protected]c14a6802014-07-11 21:51:1273#endif
[email protected]3a276ff2014-08-12 14:22:0974 public SyncTypePreferenceProvider,
jam1c5a91492016-02-24 20:47:5375#if !defined(OS_ANDROID)
droger507e7e2f2015-04-03 18:56:2376 public sync_driver::SyncServiceObserver,
bauerbce9a1a82014-12-18 13:34:2477 public chrome::BrowserListObserver,
bauerb5f8cda92015-10-07 15:36:4478#endif
bauerbce9a1a82014-12-18 13:34:2479 public SupervisedUserURLFilter::Observer {
[email protected]0850e842013-01-19 03:44:3180 public:
treib8ecc1eb52015-03-04 18:29:0681 using NavigationBlockedCallback = base::Callback<void(content::WebContents*)>;
82 using AuthErrorCallback = base::Callback<void(const GoogleServiceAuthError&)>;
83 using SuccessCallback = base::Callback<void(bool)>;
[email protected]0850e842013-01-19 03:44:3184
[email protected]f085fdd52014-06-11 18:09:2085 class Delegate {
86 public:
87 virtual ~Delegate() {}
88 // Returns true to indicate that the delegate handled the (de)activation, or
[email protected]cce15bb2014-06-17 13:43:5189 // false to indicate that the SupervisedUserService itself should handle it.
[email protected]f085fdd52014-06-11 18:09:2090 virtual bool SetActive(bool active) = 0;
[email protected]f085fdd52014-06-11 18:09:2091 };
92
dchengc072fff2014-10-21 11:39:0593 ~SupervisedUserService() override;
[email protected]0850e842013-01-19 03:44:3194
[email protected]37ca3fe02013-07-05 15:32:4495 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
[email protected]0850e842013-01-19 03:44:3196
bauerb5f8cda92015-10-07 15:36:4497 // Initializes this object.
98 void Init();
99
[email protected]f085fdd52014-06-11 18:09:20100 void SetDelegate(Delegate* delegate);
101
[email protected]0850e842013-01-19 03:44:31102 // Returns the URL filter for the IO thread, for filtering network requests
[email protected]cce15bb2014-06-17 13:43:51103 // (in SupervisedUserResourceThrottle).
104 scoped_refptr<const SupervisedUserURLFilter> GetURLFilterForIOThread();
[email protected]0850e842013-01-19 03:44:31105
106 // Returns the URL filter for the UI thread, for filtering navigations and
107 // classifying sites in the history view.
[email protected]cce15bb2014-06-17 13:43:51108 SupervisedUserURLFilter* GetURLFilterForUIThread();
[email protected]0850e842013-01-19 03:44:31109
bauerb4da36132014-12-26 19:53:13110 // Returns the whitelist service.
111 SupervisedUserWhitelistService* GetWhitelistService();
112
atanasova9572aaf2016-02-26 18:08:26113 const std::vector<scoped_refptr<SupervisedUserSiteList>>& whitelists() const {
114 return whitelists_;
115 }
116
treib8ecc1eb52015-03-04 18:29:06117 // Whether the user can request to get access to blocked URLs or to new
118 // extensions.
[email protected]0369d6ab2013-08-09 01:52:59119 bool AccessRequestsEnabled();
120
treib8ecc1eb52015-03-04 18:29:06121 // Adds an access request for the given URL.
122 void AddURLAccessRequest(const GURL& url, const SuccessCallback& callback);
123
atanasovaac676032016-04-05 16:31:05124 // Reports |url| to the SafeSearch API, because the user thinks this is an
125 // inappropriate URL.
126 void ReportURL(const GURL& url, const SuccessCallback& callback);
127
treib8ecc1eb52015-03-04 18:29:06128 // Adds an update request for the given WebStore item (App/Extension).
129 void AddExtensionUpdateRequest(const std::string& extension_id,
treibf832a992015-03-24 18:09:24130 const base::Version& version,
treib8ecc1eb52015-03-04 18:29:06131 const SuccessCallback& callback);
[email protected]e861bba2013-06-17 15:20:54132
treib40d3ad92015-10-20 18:15:42133 // Same as above, but without a callback, just logging errors on failure.
134 void AddExtensionUpdateRequest(const std::string& extension_id,
135 const base::Version& version);
136
137 // Get the string used to identify an extension update request. Public for
138 // testing.
139 static std::string GetExtensionUpdateRequestId(
140 const std::string& extension_id,
141 const base::Version& version);
142
[email protected]a9c2d642013-05-31 14:37:14143 // Returns the email address of the custodian.
144 std::string GetCustodianEmailAddress() const;
145
[email protected]fae057a2013-06-21 22:46:08146 // Returns the name of the custodian, or the email address if the name is
147 // empty.
148 std::string GetCustodianName() const;
149
treib3e7ecf72014-10-24 16:44:07150 // Returns the email address of the second custodian, or the empty string
151 // if there is no second custodian.
152 std::string GetSecondCustodianEmailAddress() const;
153
154 // Returns the name of the second custodian, or the email address if the name
155 // is empty, or the empty string is there is no second custodian.
156 std::string GetSecondCustodianName() const;
157
treib2170ea02015-10-13 14:55:12158 // Returns a message saying that extensions can only be modified by the
159 // custodian.
160 base::string16 GetExtensionsLockedMessage() const;
161
jam1c5a91492016-02-24 20:47:53162#if !defined(OS_ANDROID)
[email protected]a243d644c2013-06-20 18:37:55163 // Initializes this profile for syncing, using the provided |refresh_token| to
164 // mint access tokens for Sync.
165 void InitSync(const std::string& refresh_token);
[email protected]acfcfbb2013-05-13 18:01:27166
[email protected]cce15bb2014-06-17 13:43:51167 // Convenience method that registers this supervised user using
[email protected]458d59442013-08-01 14:19:32168 // |registration_utility| and initializes sync with the returned token.
169 // The |callback| will be called when registration is complete,
[email protected]3a276ff2014-08-12 14:22:09170 // whether it succeeded or not -- unless registration was cancelled manually,
[email protected]458d59442013-08-01 14:19:32171 // in which case the callback will be ignored.
[email protected]cce15bb2014-06-17 13:43:51172 void RegisterAndInitSync(
173 SupervisedUserRegistrationUtility* registration_utility,
174 Profile* custodian_profile,
175 const std::string& supervised_user_id,
176 const AuthErrorCallback& callback);
thestig1b76f1a2015-09-30 22:52:38177#endif
[email protected]acfcfbb2013-05-13 18:01:27178
[email protected]438f7e12013-08-07 06:59:00179 void AddNavigationBlockedCallback(const NavigationBlockedCallback& callback);
180 void DidBlockNavigation(content::WebContents* web_contents);
181
treibab0a39e2014-09-24 14:48:28182 void AddObserver(SupervisedUserServiceObserver* observer);
183 void RemoveObserver(SupervisedUserServiceObserver* observer);
184
treib531fc7312014-12-09 12:49:20185 void AddPermissionRequestCreator(
186 scoped_ptr<PermissionRequestCreator> creator);
bauerb646019b12014-10-16 16:23:09187
atanasovaac676032016-04-05 16:31:05188 void SetSafeSearchURLReporter(scoped_ptr<SafeSearchURLReporter> reporter);
189
bauerb5f8cda92015-10-07 15:36:44190 // ProfileKeyedService override:
191 void Shutdown() override;
192
[email protected]3a276ff2014-08-12 14:22:09193 // SyncTypePreferenceProvider implementation:
dchengc072fff2014-10-21 11:39:05194 syncer::ModelTypeSet GetPreferredDataTypes() const override;
[email protected]3a276ff2014-08-12 14:22:09195
jam1c5a91492016-02-24 20:47:53196#if !defined(OS_ANDROID)
droger507e7e2f2015-04-03 18:56:23197 // sync_driver::SyncServiceObserver implementation:
dchengc072fff2014-10-21 11:39:05198 void OnStateChanged() override;
[email protected]0850e842013-01-19 03:44:31199
[email protected]dfddd022013-07-10 17:29:48200 // chrome::BrowserListObserver implementation:
dchengc072fff2014-10-21 11:39:05201 void OnBrowserSetLastActive(Browser* browser) override;
jam1c5a91492016-02-24 20:47:53202#endif // !defined(OS_ANDROID)
[email protected]dfddd022013-07-10 17:29:48203
bauerbce9a1a82014-12-18 13:34:24204 // SupervisedUserURLFilter::Observer implementation:
205 void OnSiteListUpdated() override;
206
[email protected]0850e842013-01-19 03:44:31207 private:
[email protected]cce15bb2014-06-17 13:43:51208 friend class SupervisedUserServiceExtensionTestBase;
209 friend class SupervisedUserServiceFactory;
pvalenzuelac2ca4582014-10-14 19:24:57210 FRIEND_TEST_ALL_PREFIXES(SingleClientSupervisedUserSettingsSyncTest, Sanity);
[email protected]cce15bb2014-06-17 13:43:51211 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest, ClearOmitOnRegistration);
fhorschig1f351f02014-09-30 12:30:22212 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest,
213 ChangesIncludedSessionOnChangedSettings);
214 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceTest,
215 ChangesSyncSessionStateOnChangedSettings);
treibbb9a1962015-02-25 13:40:59216 FRIEND_TEST_ALL_PREFIXES(SupervisedUserServiceExtensionTest,
217 ExtensionManagementPolicyProvider);
bauerb95a50682015-01-07 17:04:15218
treib8ecc1eb52015-03-04 18:29:06219 using CreatePermissionRequestCallback =
220 base::Callback<void(PermissionRequestCreator*, const SuccessCallback&)>;
221
[email protected]cce15bb2014-06-17 13:43:51222 // A bridge from the UI thread to the SupervisedUserURLFilters, one of which
223 // lives on the IO thread. This class mediates access to them and makes sure
224 // they are kept in sync.
[email protected]0850e842013-01-19 03:44:31225 class URLFilterContext {
226 public:
227 URLFilterContext();
228 ~URLFilterContext();
229
[email protected]cce15bb2014-06-17 13:43:51230 SupervisedUserURLFilter* ui_url_filter() const;
231 SupervisedUserURLFilter* io_url_filter() const;
[email protected]0850e842013-01-19 03:44:31232
233 void SetDefaultFilteringBehavior(
[email protected]cce15bb2014-06-17 13:43:51234 SupervisedUserURLFilter::FilteringBehavior behavior);
bauerb95a50682015-01-07 17:04:15235 void LoadWhitelists(
236 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists);
treib9cc1b112016-01-08 10:08:01237 // TODO(treib): Make SupervisedUserBlacklist refcounted, so the IO thread
238 // will retain a reference to the blacklist.
239 void SetBlacklist(const SupervisedUserBlacklist* blacklist);
240 bool HasBlacklist() const;
bauerb95a50682015-01-07 17:04:15241 void SetManualHosts(scoped_ptr<std::map<std::string, bool>> host_map);
242 void SetManualURLs(scoped_ptr<std::map<GURL, bool>> url_map);
[email protected]0850e842013-01-19 03:44:31243
maxbogue8e4fb452015-02-11 20:26:09244 void InitAsyncURLChecker(
treibd3f8b7a2015-04-10 11:41:33245 const scoped_refptr<net::URLRequestContextGetter>& context);
treib9cc1b112016-01-08 10:08:01246 bool HasAsyncURLChecker() const;
247 void ClearAsyncURLChecker();
treib9e4fab902014-10-29 14:25:26248
treib22c3a042015-01-15 21:30:13249 void Clear();
250
[email protected]0850e842013-01-19 03:44:31251 private:
bauerbce9a1a82014-12-18 13:34:24252 void OnBlacklistLoaded(const base::Closure& callback);
treib4edbded2014-09-05 08:43:55253
[email protected]cce15bb2014-06-17 13:43:51254 // SupervisedUserURLFilter is refcounted because the IO thread filter is
255 // used both by ProfileImplIOData and OffTheRecordProfileIOData (to filter
[email protected]0850e842013-01-19 03:44:31256 // network requests), so they both keep a reference to it.
257 // Clients should not keep references to the UI thread filter, however
258 // (the filter will live as long as the profile lives, and afterwards it
259 // should not be used anymore either).
[email protected]cce15bb2014-06-17 13:43:51260 scoped_refptr<SupervisedUserURLFilter> ui_url_filter_;
261 scoped_refptr<SupervisedUserURLFilter> io_url_filter_;
[email protected]0850e842013-01-19 03:44:31262
[email protected]0850e842013-01-19 03:44:31263 DISALLOW_COPY_AND_ASSIGN(URLFilterContext);
264 };
265
[email protected]cce15bb2014-06-17 13:43:51266 // Use |SupervisedUserServiceFactory::GetForProfile(..)| to get
[email protected]3bf45d02013-07-10 00:03:41267 // an instance of this service.
[email protected]cce15bb2014-06-17 13:43:51268 explicit SupervisedUserService(Profile* profile);
[email protected]3bf45d02013-07-10 00:03:41269
[email protected]f085fdd52014-06-11 18:09:20270 void SetActive(bool active);
271
jam1c5a91492016-02-24 20:47:53272#if !defined(OS_ANDROID)
[email protected]0085863a2013-12-06 21:19:03273 void OnCustodianProfileDownloaded(const base::string16& full_name);
[email protected]200729f82013-06-22 07:05:55274
[email protected]cce15bb2014-06-17 13:43:51275 void OnSupervisedUserRegistered(const AuthErrorCallback& callback,
276 Profile* custodian_profile,
277 const GoogleServiceAuthError& auth_error,
278 const std::string& token);
[email protected]acfcfbb2013-05-13 18:01:27279
[email protected]a243d644c2013-06-20 18:37:55280 void SetupSync();
[email protected]6e08b9a62014-07-08 00:32:48281 void StartSetupSync();
282 void FinishSetupSyncWhenReady();
283 void FinishSetupSync();
bauerb5f8cda92015-10-07 15:36:44284#endif
[email protected]a243d644c2013-06-20 18:37:55285
[email protected]cce15bb2014-06-17 13:43:51286 bool ProfileIsSupervised() const;
[email protected]e000daf2013-07-31 16:50:58287
treib3fce4e92014-09-26 16:06:25288 void OnCustodianInfoChanged();
289
[email protected]c14a6802014-07-11 21:51:12290#if defined(ENABLE_EXTENSIONS)
treibbb9a1962015-02-25 13:40:59291 // extensions::ManagementPolicy::Provider implementation:
292 std::string GetDebugPolicyProviderName() const override;
293 bool UserMayLoad(const extensions::Extension* extension,
294 base::string16* error) const override;
treib755c12d2015-03-30 08:46:25295 bool UserMayModifySettings(const extensions::Extension* extension,
296 base::string16* error) const override;
treibbb9a1962015-02-25 13:40:59297 bool MustRemainInstalled(const extensions::Extension* extension,
298 base::string16* error) const override;
[email protected]0850e842013-01-19 03:44:31299
[email protected]c14a6802014-07-11 21:51:12300 // Extensions helper to SetActive().
301 void SetExtensionsActive();
302#endif
303
[email protected]cce15bb2014-06-17 13:43:51304 SupervisedUserSettingsService* GetSettingsService();
[email protected]e861bba2013-06-17 15:20:54305
bauerbd3a36cc42014-10-01 13:05:49306 size_t FindEnabledPermissionRequestCreator(size_t start);
treib8ecc1eb52015-03-04 18:29:06307 void AddPermissionRequestInternal(
308 const CreatePermissionRequestCallback& create_request,
309 const SuccessCallback& callback,
310 size_t index);
311 void OnPermissionRequestIssued(
312 const CreatePermissionRequestCallback& create_request,
313 const SuccessCallback& callback,
314 size_t index,
315 bool success);
bauerbd3a36cc42014-10-01 13:05:49316
[email protected]cce15bb2014-06-17 13:43:51317 void OnSupervisedUserIdChanged();
[email protected]f085fdd52014-06-11 18:09:20318
[email protected]0850e842013-01-19 03:44:31319 void OnDefaultFilteringBehaviorChanged();
320
treib9cc1b112016-01-08 10:08:01321 void OnSafeSitesSettingChanged();
322
bauerb95a50682015-01-07 17:04:15323 void OnSiteListsChanged(
324 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists);
[email protected]0850e842013-01-19 03:44:31325
treib2fd187392015-04-16 17:19:38326 // Asynchronously loads a blacklist from a binary file at |path| and applies
327 // it to the URL filters. If no file exists at |path| yet, downloads a file
328 // from |url| and stores it at |path| first.
treibf136dfb2014-09-25 17:37:47329 void LoadBlacklist(const base::FilePath& path, const GURL& url);
330
treib2fd187392015-04-16 17:19:38331 void OnBlacklistFileChecked(const base::FilePath& path,
332 const GURL& url,
333 bool file_exists);
334
335 // Asynchronously loads a blacklist from a binary file at |path| and applies
336 // it to the URL filters.
treibf136dfb2014-09-25 17:37:47337 void LoadBlacklistFromFile(const base::FilePath& path);
338
339 void OnBlacklistDownloadDone(const base::FilePath& path, bool success);
treib4edbded2014-09-05 08:43:55340
bauerbce9a1a82014-12-18 13:34:24341 void OnBlacklistLoaded();
342
treib9cc1b112016-01-08 10:08:01343 void UpdateBlacklist();
344
[email protected]5e022292013-02-06 16:42:17345 // Updates the manual overrides for hosts in the URL filters when the
346 // corresponding preference is changed.
347 void UpdateManualHosts();
[email protected]0850e842013-01-19 03:44:31348
[email protected]5e022292013-02-06 16:42:17349 // Updates the manual overrides for URLs in the URL filters when the
350 // corresponding preference is changed.
351 void UpdateManualURLs();
[email protected]0850e842013-01-19 03:44:31352
[email protected]0b4c6b22014-08-04 09:46:31353 // Returns the human readable name of the supervised user.
354 std::string GetSupervisedUserName() const;
355
fhorschig1f351f02014-09-30 12:30:22356 // Subscribes to the SupervisedUserPrefStore, refreshes
357 // |includes_sync_sessions_type_| and triggers reconfiguring the
358 // ProfileSyncService.
359 void OnHistoryRecordingStateChanged();
360
361 // Returns true if the syncer::SESSIONS type should be included in Sync.
362 bool IncludesSyncSessionsType() const;
363
364 // The option a custodian sets to either record or prevent recording the
365 // supervised user's history. Set by |FetchNewSessionSyncState()| and
366 // defaults to true.
367 bool includes_sync_sessions_type_;
368
[email protected]12b7af32014-03-13 05:28:20369 // Owns us via the KeyedService mechanism.
[email protected]0850e842013-01-19 03:44:31370 Profile* profile_;
371
[email protected]f085fdd52014-06-11 18:09:20372 bool active_;
373
374 Delegate* delegate_;
375
[email protected]0850e842013-01-19 03:44:31376 PrefChangeRegistrar pref_change_registrar_;
377
[email protected]a243d644c2013-06-20 18:37:55378 // True iff we're waiting for the Sync service to be initialized.
379 bool waiting_for_sync_initialization_;
[email protected]dfddd022013-07-10 17:29:48380 bool is_profile_active_;
[email protected]a243d644c2013-06-20 18:37:55381
[email protected]438f7e12013-08-07 06:59:00382 std::vector<NavigationBlockedCallback> navigation_blocked_callbacks_;
383
[email protected]3a276ff2014-08-12 14:22:09384 // True only when |Init()| method has been called.
385 bool did_init_;
386
[email protected]3bf45d02013-07-10 00:03:41387 // True only when |Shutdown()| method has been called.
388 bool did_shutdown_;
389
[email protected]0850e842013-01-19 03:44:31390 URLFilterContext url_filter_context_;
treib9cc1b112016-01-08 10:08:01391
392 enum class BlacklistLoadState {
393 NOT_LOADED,
394 LOAD_STARTED,
395 LOADED
396 } blacklist_state_;
397
398 SupervisedUserBlacklist blacklist_;
treibcffa6502015-08-06 09:12:27399 scoped_ptr<FileDownloader> blacklist_downloader_;
[email protected]8052b242013-11-15 16:40:55400
bauerb4da36132014-12-26 19:53:13401 scoped_ptr<SupervisedUserWhitelistService> whitelist_service_;
402
atanasova9572aaf2016-02-26 18:08:26403 std::vector<scoped_refptr<SupervisedUserSiteList>> whitelists_;
404
[email protected]4db65f952014-05-20 15:46:30405 // Used to create permission requests.
bauerbd3a36cc42014-10-01 13:05:49406 ScopedVector<PermissionRequestCreator> permissions_creators_;
[email protected]4db65f952014-05-20 15:46:30407
atanasovaac676032016-04-05 16:31:05408 // Used to report inappropriate URLs to SafeSarch API.
409 scoped_ptr<SafeSearchURLReporter> url_reporter_;
410
brettwd195c952015-06-02 17:31:12411 base::ObserverList<SupervisedUserServiceObserver> observer_list_;
treibab0a39e2014-09-24 14:48:28412
[email protected]cce15bb2014-06-17 13:43:51413 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_;
[email protected]0850e842013-01-19 03:44:31414};
415
[email protected]cce15bb2014-06-17 13:43:51416#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_