blob: d1fbed1cf3763176669d6bbead535e827b7696ca [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
dchengf624e472016-04-12 08:33:1710#include <memory>
Toby Huang016f549b2020-05-04 19:50:4711#include <set>
treib950c6e82014-09-23 13:07:2912#include <string>
[email protected]0850e842013-01-19 03:44:3113#include <vector>
14
[email protected]438f7e12013-08-07 06:59:0015#include "base/callback.h"
[email protected]076ebeda2014-06-06 21:47:2616#include "base/gtest_prod_util.h"
avi664c07b2015-12-26 02:18:3117#include "base/macros.h"
treibab0a39e2014-09-24 14:48:2818#include "base/observer_list.h"
[email protected]f2253ac2014-05-28 08:37:2119#include "base/scoped_observer.h"
[email protected]f9b294362013-06-10 20:22:3120#include "base/strings/string16.h"
avi664c07b2015-12-26 02:18:3121#include "build/build_config.h"
treibf38cc252016-04-07 14:44:1122#include "chrome/browser/net/file_downloader.h"
Aga Wronska289815c72020-01-28 21:35:2323#include "chrome/browser/supervised_user/supervised_user_blacklist.h"
[email protected]cce15bb2014-06-17 13:43:5124#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
25#include "chrome/browser/supervised_user/supervised_users.h"
[email protected]514fcf22013-08-13 06:37:2426#include "chrome/browser/ui/browser_list_observer.h"
[email protected]12b7af32014-03-13 05:28:2027#include "components/keyed_service/core/keyed_service.h"
brettwb1fc1b82016-02-02 00:19:0828#include "components/prefs/pref_change_registrar.h"
maxbogue455a57e32016-08-14 00:08:3229#include "components/sync/driver/sync_type_preference_provider.h"
Scott Violetc8240b02018-03-08 22:03:5930#include "extensions/buildflags/buildflags.h"
[email protected]c14a6802014-07-11 21:51:1231
brettw00899e62016-11-12 02:10:1732#if BUILDFLAG(ENABLE_EXTENSIONS)
Danan Se5ba3312020-03-05 03:34:5533#include "base/strings/string16.h"
34#include "chrome/browser/ui/supervised_user/parent_permission_dialog.h"
Evan Stade2fad9012019-10-09 18:47:5035#include "extensions/browser/extension_registry.h"
mamire9609642016-06-28 22:17:5436#include "extensions/browser/extension_registry_observer.h"
[email protected]301116c62013-11-26 10:37:4537#include "extensions/browser/management_policy.h"
[email protected]c14a6802014-07-11 21:51:1238#endif
[email protected]0850e842013-01-19 03:44:3139
[email protected]509ad1a92013-03-19 21:41:0640class Browser;
[email protected]4db65f952014-05-20 15:46:3041class PermissionRequestCreator;
Toby Huang20091252020-04-03 03:27:0642class PrefService;
[email protected]0850e842013-01-19 03:44:3143class Profile;
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
Danan Se5ba3312020-03-05 03:34:5555#if BUILDFLAG(ENABLE_EXTENSIONS)
Danan Se5ba3312020-03-05 03:34:5556namespace extensions {
57class Extension;
58}
59#endif
60
[email protected]443e9312013-05-06 06:17:3461namespace user_prefs {
62class PrefRegistrySyncable;
63}
64
[email protected]cce15bb2014-06-17 13:43:5165// This class handles all the information related to a given supervised profile
[email protected]0850e842013-01-19 03:44:3166// (e.g. the installed content packs, the default URL filtering behavior, or
67// manual whitelist/blacklist overrides).
[email protected]cce15bb2014-06-17 13:43:5168class SupervisedUserService : public KeyedService,
brettw00899e62016-11-12 02:10:1769#if BUILDFLAG(ENABLE_EXTENSIONS)
mamire9609642016-06-28 22:17:5470 public extensions::ExtensionRegistryObserver,
[email protected]cce15bb2014-06-17 13:43:5171 public extensions::ManagementPolicy::Provider,
[email protected]c14a6802014-07-11 21:51:1272#endif
maxbogue7e006db2016-10-03 19:48:2873 public syncer::SyncTypePreferenceProvider,
jam1c5a91492016-02-24 20:47:5374#if !defined(OS_ANDROID)
cm.sanchia0d6add2017-12-13 04:59:3375 public BrowserListObserver,
bauerb5f8cda92015-10-07 15:36:4476#endif
bauerbce9a1a82014-12-18 13:34:2477 public SupervisedUserURLFilter::Observer {
[email protected]0850e842013-01-19 03:44:3178 public:
Carlos IL6b784a62018-03-20 00:26:4979 using SuccessCallback = base::OnceCallback<void(bool)>;
[email protected]0850e842013-01-19 03:44:3180
[email protected]f085fdd52014-06-11 18:09:2081 class Delegate {
82 public:
83 virtual ~Delegate() {}
84 // Returns true to indicate that the delegate handled the (de)activation, or
[email protected]cce15bb2014-06-17 13:43:5185 // false to indicate that the SupervisedUserService itself should handle it.
[email protected]f085fdd52014-06-11 18:09:2086 virtual bool SetActive(bool active) = 0;
87 };
88
Toby Huang20091252020-04-03 03:27:0689#if BUILDFLAG(ENABLE_EXTENSIONS)
90 // These enum values represent operations to manage the
Toby Huang016f549b2020-05-04 19:50:4791 // kSupervisedUserApprovedExtensions user pref, which stores parent approved
92 // extension ids.
Toby Huang20091252020-04-03 03:27:0693 enum class ApprovedExtensionChange {
94 // Adds a new approved extension to the pref.
Toby Huang016f549b2020-05-04 19:50:4795 kAdd,
Toby Huang20091252020-04-03 03:27:0696 // Removes extension approval.
97 kRemove
98 };
99#endif // BUILDFLAG(ENABLE_EXTENSIONS)
100
dchengc072fff2014-10-21 11:39:05101 ~SupervisedUserService() override;
[email protected]0850e842013-01-19 03:44:31102
[email protected]37ca3fe02013-07-05 15:32:44103 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
[email protected]0850e842013-01-19 03:44:31104
bauerb5f8cda92015-10-07 15:36:44105 // Initializes this object.
106 void Init();
107
[email protected]f085fdd52014-06-11 18:09:20108 void SetDelegate(Delegate* delegate);
109
mmenkedb2637ff2017-03-30 23:59:42110 // Returns the URL filter for filtering navigations and classifying sites in
111 // the history view. Both this method and the returned filter may only be used
112 // on the UI thread.
113 SupervisedUserURLFilter* GetURLFilter();
[email protected]0850e842013-01-19 03:44:31114
bauerb4da36132014-12-26 19:53:13115 // Returns the whitelist service.
116 SupervisedUserWhitelistService* GetWhitelistService();
117
atanasova9572aaf2016-02-26 18:08:26118 const std::vector<scoped_refptr<SupervisedUserSiteList>>& whitelists() const {
119 return whitelists_;
120 }
121
treib8ecc1eb52015-03-04 18:29:06122 // Whether the user can request to get access to blocked URLs or to new
123 // extensions.
[email protected]0369d6ab2013-08-09 01:52:59124 bool AccessRequestsEnabled();
125
treib8ecc1eb52015-03-04 18:29:06126 // Adds an access request for the given URL.
Carlos IL6b784a62018-03-20 00:26:49127 void AddURLAccessRequest(const GURL& url, SuccessCallback callback);
treib8ecc1eb52015-03-04 18:29:06128
mamire9609642016-06-28 22:17:54129 // Get the string used to identify an extension install or update request.
130 // Public for testing.
131 static std::string GetExtensionRequestId(const std::string& extension_id,
132 const base::Version& version);
treib40d3ad92015-10-20 18:15:42133
[email protected]a9c2d642013-05-31 14:37:14134 // Returns the email address of the custodian.
135 std::string GetCustodianEmailAddress() const;
136
Danan Sbef6ca22019-05-09 18:15:54137 // Returns the obfuscated GAIA id of the custodian.
138 std::string GetCustodianObfuscatedGaiaId() const;
139
[email protected]fae057a2013-06-21 22:46:08140 // Returns the name of the custodian, or the email address if the name is
141 // empty.
142 std::string GetCustodianName() const;
143
treib3e7ecf72014-10-24 16:44:07144 // Returns the email address of the second custodian, or the empty string
145 // if there is no second custodian.
146 std::string GetSecondCustodianEmailAddress() const;
147
Danan Sbef6ca22019-05-09 18:15:54148 // Returns the obfuscated GAIA id of the second custodian or the empty
149 // string if there is no second custodian.
150 std::string GetSecondCustodianObfuscatedGaiaId() const;
151
treib3e7ecf72014-10-24 16:44:07152 // Returns the name of the second custodian, or the email address if the name
Danan Sbef6ca22019-05-09 18:15:54153 // is empty, or the empty string if there is no second custodian.
treib3e7ecf72014-10-24 16:44:07154 std::string GetSecondCustodianName() const;
155
treib2170ea02015-10-13 14:55:12156 // Returns a message saying that extensions can only be modified by the
157 // custodian.
158 base::string16 GetExtensionsLockedMessage() const;
159
yilkal190d97c2019-09-06 23:50:03160 bool IsSupervisedUserIframeFilterEnabled() const;
161
Danan Se5ba3312020-03-05 03:34:55162 // Returns true if the user is a type of Family Link Child account,
163 // but will not return true for a Legacy Supervised user (or non child users).
164 bool IsChild() const;
165
166 bool IsSupervisedUserExtensionInstallEnabled() const;
167
168 // Returns true if there is a custodian for the child. A child can have
169 // up to 2 custodians, and this returns true if they have at least 1.
170 bool HasACustodian() const;
171
treibab0a39e2014-09-24 14:48:28172 void AddObserver(SupervisedUserServiceObserver* observer);
173 void RemoveObserver(SupervisedUserServiceObserver* observer);
174
treib531fc7312014-12-09 12:49:20175 void AddPermissionRequestCreator(
dchengf624e472016-04-12 08:33:17176 std::unique_ptr<PermissionRequestCreator> creator);
bauerb646019b12014-10-16 16:23:09177
bauerb5f8cda92015-10-07 15:36:44178 // ProfileKeyedService override:
179 void Shutdown() override;
180
[email protected]3a276ff2014-08-12 14:22:09181 // SyncTypePreferenceProvider implementation:
Marc Treibb3bbf1d22019-03-27 15:45:39182 bool IsEncryptEverythingAllowed() const override;
[email protected]3a276ff2014-08-12 14:22:09183
jam1c5a91492016-02-24 20:47:53184#if !defined(OS_ANDROID)
cm.sanchia0d6add2017-12-13 04:59:33185 // BrowserListObserver implementation:
dchengc072fff2014-10-21 11:39:05186 void OnBrowserSetLastActive(Browser* browser) override;
jam1c5a91492016-02-24 20:47:53187#endif // !defined(OS_ANDROID)
[email protected]dfddd022013-07-10 17:29:48188
bauerbce9a1a82014-12-18 13:34:24189 // SupervisedUserURLFilter::Observer implementation:
190 void OnSiteListUpdated() override;
191
Danan Sc1945912019-06-27 02:56:30192#if !defined(OS_ANDROID)
193 bool signout_required_after_supervision_enabled() {
194 return signout_required_after_supervision_enabled_;
195 }
196 void set_signout_required_after_supervision_enabled() {
197 signout_required_after_supervision_enabled_ = true;
198 }
199#endif // !defined(OS_ANDROID)
200
yilkal921048bd2019-10-09 23:51:04201 void SetPrimaryPermissionCreatorForTest(
202 std::unique_ptr<PermissionRequestCreator> permission_creator);
203
Toby Huang6f0321f2019-11-01 18:03:49204#if BUILDFLAG(ENABLE_EXTENSIONS)
Toby Huang016f549b2020-05-04 19:50:47205 // Updates the set of approved extensions to add approval for |extension|.
206 void AddExtensionApproval(const extensions::Extension& extension);
Danan Se5ba3312020-03-05 03:34:55207
Toby Huang016f549b2020-05-04 19:50:47208 // Updates the set of approved extensions to remove approval for |extension|.
Danan Se5ba3312020-03-05 03:34:55209 void RemoveExtensionApproval(const extensions::Extension& extension);
210
Toby Huang016f549b2020-05-04 19:50:47211 // Wraps UpdateApprovedExtension() for testing. Use this to simulate adding or
212 // removing custodian approval for an extension via sync.
Toby Huang20091252020-04-03 03:27:06213 void UpdateApprovedExtensionForTesting(const std::string& extension_id,
Toby Huang20091252020-04-03 03:27:06214 ApprovedExtensionChange type);
Toby Huang114e9b02019-11-23 02:42:13215
216 bool GetSupervisedUserExtensionsMayRequestPermissionsPref() const;
217
218 void SetSupervisedUserExtensionsMayRequestPermissionsPrefForTesting(
219 bool enabled);
Toby Huang7b4816f2020-02-07 23:54:07220
Danan Se5ba3312020-03-05 03:34:55221 bool CanInstallExtensions() const;
222
223 bool IsExtensionAllowed(const extensions::Extension& extension) const;
Toby Huang6f0321f2019-11-01 18:03:49224#endif // BUILDFLAG(ENABLE_EXTENSIONS)
225
[email protected]0850e842013-01-19 03:44:31226 private:
[email protected]cce15bb2014-06-17 13:43:51227 friend class SupervisedUserServiceExtensionTestBase;
228 friend class SupervisedUserServiceFactory;
mamire9609642016-06-28 22:17:54229 FRIEND_TEST_ALL_PREFIXES(
230 SupervisedUserServiceExtensionTest,
231 ExtensionManagementPolicyProviderWithoutSUInitiatedInstalls);
232 FRIEND_TEST_ALL_PREFIXES(
233 SupervisedUserServiceExtensionTest,
234 ExtensionManagementPolicyProviderWithSUInitiatedInstalls);
bauerb95a50682015-01-07 17:04:15235
treib8ecc1eb52015-03-04 18:29:06236 using CreatePermissionRequestCallback =
Carlos IL6b784a62018-03-20 00:26:49237 base::RepeatingCallback<void(PermissionRequestCreator*, SuccessCallback)>;
treib8ecc1eb52015-03-04 18:29:06238
[email protected]cce15bb2014-06-17 13:43:51239 // Use |SupervisedUserServiceFactory::GetForProfile(..)| to get
[email protected]3bf45d02013-07-10 00:03:41240 // an instance of this service.
[email protected]cce15bb2014-06-17 13:43:51241 explicit SupervisedUserService(Profile* profile);
[email protected]3bf45d02013-07-10 00:03:41242
[email protected]f085fdd52014-06-11 18:09:20243 void SetActive(bool active);
244
treib3fce4e92014-09-26 16:06:25245 void OnCustodianInfoChanged();
246
brettw00899e62016-11-12 02:10:17247#if BUILDFLAG(ENABLE_EXTENSIONS)
treibbb9a1962015-02-25 13:40:59248 // extensions::ManagementPolicy::Provider implementation:
249 std::string GetDebugPolicyProviderName() const override;
250 bool UserMayLoad(const extensions::Extension* extension,
251 base::string16* error) const override;
mamire9609642016-06-28 22:17:54252 bool MustRemainDisabled(const extensions::Extension* extension,
Minh X. Nguyen45479012017-08-18 21:35:36253 extensions::disable_reason::DisableReason* reason,
mamire9609642016-06-28 22:17:54254 base::string16* error) const override;
255
256 // extensions::ExtensionRegistryObserver overrides:
257 void OnExtensionInstalled(content::BrowserContext* browser_context,
258 const extensions::Extension* extension,
259 bool is_update) override;
[email protected]0850e842013-01-19 03:44:31260
Danan Se5ba3312020-03-05 03:34:55261 void OnExtensionUninstalled(content::BrowserContext* browser_context,
262 const extensions::Extension* extension,
263 extensions::UninstallReason reason) override;
264
mamir192d7882016-06-22 17:10:16265 // An extension can be in one of the following states:
266 //
Toby Huang114e9b02019-11-23 02:42:13267 // BLOCKED: if kSupervisedUserExtensionsMayRequestPermissions is false and the
268 // child user is attempting to install a new extension or an existing
269 // extension is asking for additional permissions.
mamir192d7882016-06-22 17:10:16270 // ALLOWED: Components, Themes, Default extensions ..etc
271 // are generally allowed. Extensions that have been approved by the
272 // custodian are also allowed.
Toby Huang114e9b02019-11-23 02:42:13273 // REQUIRE_APPROVAL: if it is installed by the child user and
274 // hasn't been approved by the custodian yet.
Toby Huangd7caf252019-10-30 01:11:16275 enum class ExtensionState { BLOCKED, ALLOWED, REQUIRE_APPROVAL };
mamir192d7882016-06-22 17:10:16276
Toby Huang114e9b02019-11-23 02:42:13277 // Returns the state of an extension whether being BLOCKED, ALLOWED or
mamire9609642016-06-28 22:17:54278 // REQUIRE_APPROVAL from the Supervised User service's point of view.
mamir192d7882016-06-22 17:10:16279 ExtensionState GetExtensionState(
mamire9609642016-06-28 22:17:54280 const extensions::Extension& extension) const;
mamir192d7882016-06-22 17:10:16281
Toby Huang05ddf272020-03-21 07:33:04282 // Returns whether we should block an extension based on the state of the
283 // "Permissions for sites, apps and extensions" toggle.
284 bool ShouldBlockExtension(const std::string& extension_id) const;
285
Toby Huang016f549b2020-05-04 19:50:47286 // Enables/Disables extensions upon change in approvals. This function is
287 // idempotent.
mamire9609642016-06-28 22:17:54288 void ChangeExtensionStateIfNecessary(const std::string& extension_id);
Toby Huang20091252020-04-03 03:27:06289
Toby Huang016f549b2020-05-04 19:50:47290 // Updates the synced set of approved extension ids.
291 // Use AddExtensionApproval() or RemoveExtensionApproval() for public access.
292 // If |type| is kAdd, then add approval.
293 // If |type| is kRemove, then remove approval.
294 // Triggers a call to RefreshApprovedExtensionsFromPrefs() via a listener.
295 // TODO(crbug/1072857): We don't need the extension version information. It's
296 // only included for backwards compatibility with previous versions of Chrome.
297 // Remove the version information once a sufficient number of users have
298 // migrated away from M83.
Toby Huang20091252020-04-03 03:27:06299 void UpdateApprovedExtension(const std::string& extension_id,
300 const std::string& version,
301 ApprovedExtensionChange type);
302
Toby Huang016f549b2020-05-04 19:50:47303 // Updates the set of approved extensions when the corresponding preference is
Toby Huang20091252020-04-03 03:27:06304 // changed.
Toby Huang016f549b2020-05-04 19:50:47305 void RefreshApprovedExtensionsFromPrefs();
Toby Huang20091252020-04-03 03:27:06306
307 // Extensions helper to SetActive().
308 void SetExtensionsActive();
Toby Huang6f0321f2019-11-01 18:03:49309#endif // BUILDFLAG(ENABLE_EXTENSIONS)
[email protected]c14a6802014-07-11 21:51:12310
Toby Huang20091252020-04-03 03:27:06311 // Returns the SupervisedUserSettingsService associated with |profile_|.
[email protected]cce15bb2014-06-17 13:43:51312 SupervisedUserSettingsService* GetSettingsService();
[email protected]e861bba2013-06-17 15:20:54313
Toby Huang20091252020-04-03 03:27:06314 // Returns the PrefService associated with |profile_|.
315 PrefService* GetPrefService();
316
bauerbd3a36cc42014-10-01 13:05:49317 size_t FindEnabledPermissionRequestCreator(size_t start);
treib8ecc1eb52015-03-04 18:29:06318 void AddPermissionRequestInternal(
319 const CreatePermissionRequestCallback& create_request,
Carlos IL6b784a62018-03-20 00:26:49320 SuccessCallback callback,
treib8ecc1eb52015-03-04 18:29:06321 size_t index);
322 void OnPermissionRequestIssued(
323 const CreatePermissionRequestCallback& create_request,
Carlos IL6b784a62018-03-20 00:26:49324 SuccessCallback callback,
treib8ecc1eb52015-03-04 18:29:06325 size_t index,
326 bool success);
bauerbd3a36cc42014-10-01 13:05:49327
[email protected]cce15bb2014-06-17 13:43:51328 void OnSupervisedUserIdChanged();
[email protected]f085fdd52014-06-11 18:09:20329
[email protected]0850e842013-01-19 03:44:31330 void OnDefaultFilteringBehaviorChanged();
331
treib9cc1b112016-01-08 10:08:01332 void OnSafeSitesSettingChanged();
333
bauerb95a50682015-01-07 17:04:15334 void OnSiteListsChanged(
335 const std::vector<scoped_refptr<SupervisedUserSiteList>>& site_lists);
[email protected]0850e842013-01-19 03:44:31336
treib2fd187392015-04-16 17:19:38337 // Asynchronously loads a blacklist from a binary file at |path| and applies
338 // it to the URL filters. If no file exists at |path| yet, downloads a file
339 // from |url| and stores it at |path| first.
treibf136dfb2014-09-25 17:37:47340 void LoadBlacklist(const base::FilePath& path, const GURL& url);
341
treib2fd187392015-04-16 17:19:38342 void OnBlacklistFileChecked(const base::FilePath& path,
343 const GURL& url,
344 bool file_exists);
345
346 // Asynchronously loads a blacklist from a binary file at |path| and applies
347 // it to the URL filters.
treibf136dfb2014-09-25 17:37:47348 void LoadBlacklistFromFile(const base::FilePath& path);
349
treibf38cc252016-04-07 14:44:11350 void OnBlacklistDownloadDone(const base::FilePath& path,
351 FileDownloader::Result result);
treib4edbded2014-09-05 08:43:55352
bauerbce9a1a82014-12-18 13:34:24353 void OnBlacklistLoaded();
354
treib9cc1b112016-01-08 10:08:01355 void UpdateBlacklist();
356
[email protected]5e022292013-02-06 16:42:17357 // Updates the manual overrides for hosts in the URL filters when the
358 // corresponding preference is changed.
359 void UpdateManualHosts();
[email protected]0850e842013-01-19 03:44:31360
[email protected]5e022292013-02-06 16:42:17361 // Updates the manual overrides for URLs in the URL filters when the
362 // corresponding preference is changed.
363 void UpdateManualURLs();
[email protected]0850e842013-01-19 03:44:31364
[email protected]12b7af32014-03-13 05:28:20365 // Owns us via the KeyedService mechanism.
[email protected]0850e842013-01-19 03:44:31366 Profile* profile_;
367
[email protected]f085fdd52014-06-11 18:09:20368 bool active_;
369
370 Delegate* delegate_;
371
[email protected]0850e842013-01-19 03:44:31372 PrefChangeRegistrar pref_change_registrar_;
373
[email protected]dfddd022013-07-10 17:29:48374 bool is_profile_active_;
[email protected]a243d644c2013-06-20 18:37:55375
[email protected]3a276ff2014-08-12 14:22:09376 // True only when |Init()| method has been called.
377 bool did_init_;
378
[email protected]3bf45d02013-07-10 00:03:41379 // True only when |Shutdown()| method has been called.
380 bool did_shutdown_;
381
mmenkedb2637ff2017-03-30 23:59:42382 SupervisedUserURLFilter url_filter_;
treib9cc1b112016-01-08 10:08:01383
Toby Huang016f549b2020-05-04 19:50:47384 // Store a set of extension ids approved by the custodian.
mamire9609642016-06-28 22:17:54385 // It is only relevant for SU-initiated installs.
Toby Huang016f549b2020-05-04 19:50:47386 std::set<std::string> approved_extensions_set_;
mamire9609642016-06-28 22:17:54387
treib9cc1b112016-01-08 10:08:01388 enum class BlacklistLoadState {
389 NOT_LOADED,
390 LOAD_STARTED,
391 LOADED
392 } blacklist_state_;
393
394 SupervisedUserBlacklist blacklist_;
dchengf624e472016-04-12 08:33:17395 std::unique_ptr<FileDownloader> blacklist_downloader_;
[email protected]8052b242013-11-15 16:40:55396
dchengf624e472016-04-12 08:33:17397 std::unique_ptr<SupervisedUserWhitelistService> whitelist_service_;
bauerb4da36132014-12-26 19:53:13398
atanasova9572aaf2016-02-26 18:08:26399 std::vector<scoped_refptr<SupervisedUserSiteList>> whitelists_;
400
[email protected]4db65f952014-05-20 15:46:30401 // Used to create permission requests.
leon.han4ea301f2017-03-28 03:36:31402 std::vector<std::unique_ptr<PermissionRequestCreator>> permissions_creators_;
[email protected]4db65f952014-05-20 15:46:30403
brettw00899e62016-11-12 02:10:17404#if BUILDFLAG(ENABLE_EXTENSIONS)
mamire9609642016-06-28 22:17:54405 ScopedObserver<extensions::ExtensionRegistry,
406 extensions::ExtensionRegistryObserver>
Evan Stade2fad9012019-10-09 18:47:50407 registry_observer_{this};
mamire9609642016-06-28 22:17:54408#endif
409
Trent Apteda250ec3ab2018-08-19 08:52:19410 base::ObserverList<SupervisedUserServiceObserver>::Unchecked observer_list_;
treibab0a39e2014-09-24 14:48:28411
Danan Sc1945912019-06-27 02:56:30412#if !defined(OS_ANDROID)
413 bool signout_required_after_supervision_enabled_ = false;
414#endif
415
Jeremy Roman495db682019-07-12 16:03:24416 base::WeakPtrFactory<SupervisedUserService> weak_ptr_factory_{this};
leon.han4ea301f2017-03-28 03:36:31417
418 DISALLOW_COPY_AND_ASSIGN(SupervisedUserService);
[email protected]0850e842013-01-19 03:44:31419};
420
[email protected]cce15bb2014-06-17 13:43:51421#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SERVICE_H_