blob: 61063f67183b3c0a7c215b60ead482df3b7cd7f1 [file] [log] [blame]
[email protected]c333e792012-01-06 16:57:391// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]6014d672008-12-05 00:38:252// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]eaa7dd182010-12-14 11:09:005#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6#define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
[email protected]6014d672008-12-05 00:38:257
[email protected]da50530a2009-06-15 17:43:018#include <map>
asargent56282ab72016-09-09 16:58:039#include <memory>
[email protected]31bb5ee62012-09-12 22:58:4010#include <set>
[email protected]b0beaa662009-02-26 00:04:1511#include <string>
[email protected]6014d672008-12-05 00:38:2512#include <vector>
13
[email protected]e0785902011-05-19 23:34:1714#include "base/compiler_specific.h"
[email protected]57999812013-02-24 05:40:5215#include "base/files/file_path.h"
[email protected]a918f872010-06-01 14:30:5116#include "base/gtest_prod_util.h"
avia2f4804a2015-12-24 23:11:1317#include "base/macros.h"
[email protected]3b63f8f42011-03-28 01:54:1518#include "base/memory/ref_counted.h"
[email protected]14908b72011-04-20 06:54:3619#include "base/memory/weak_ptr.h"
Karandeep Bhatiaa8930652017-10-11 17:41:1220#include "base/optional.h"
Evan Staded89e11c2019-09-05 18:08:5621#include "base/scoped_observer.h"
[email protected]00e7bef2013-06-10 20:35:1722#include "base/strings/string16.h"
[email protected]fdd679b2012-11-15 20:49:3923#include "chrome/browser/extensions/blacklist.h"
binjin1569c9b2014-09-05 13:33:1824#include "chrome/browser/extensions/extension_management.h"
Sergey Poromov0360b9e72018-04-19 17:37:2925#include "chrome/browser/extensions/forced_extensions/installation_tracker.h"
xiyuanf6a4c6a62016-04-19 18:14:5426#include "chrome/browser/extensions/install_gate.h"
[email protected]f3d3b382014-03-14 21:19:2827#include "chrome/browser/extensions/pending_extension_manager.h"
Evan Staded89e11c2019-09-05 18:08:5628#include "chrome/browser/profiles/profile_manager.h"
29#include "chrome/browser/profiles/profile_manager_observer.h"
Greg Thompson8bcd799b2018-08-10 09:49:3330#include "chrome/browser/upgrade_detector/upgrade_observer.h"
skym71603842016-10-10 18:17:3131#include "components/sync/model/string_ordinal.h"
[email protected]6c2381d2011-10-19 02:52:5332#include "content/public/browser/notification_observer.h"
33#include "content/public/browser/notification_registrar.h"
ginkage553af3202015-02-04 12:39:0934#include "extensions/browser/crx_file_info.h"
Ivan Sandrk4a55dc22018-05-17 18:14:4835#include "extensions/browser/disable_reason.h"
xiyuanf6a4c6a62016-04-19 18:14:5436#include "extensions/browser/extension_prefs.h"
Devlin Cronin5b35a082017-10-05 20:44:3637#include "extensions/browser/extension_registrar.h"
[email protected]301116c62013-11-26 10:37:4538#include "extensions/browser/external_provider_interface.h"
[email protected]4a1d9c0d2014-06-13 12:50:1139#include "extensions/browser/install_flag.h"
[email protected]98b6d942013-11-10 00:34:0740#include "extensions/browser/process_manager.h"
[email protected]e43c61f2014-07-20 21:46:3441#include "extensions/browser/uninstall_reason.h"
Scott Violetc8240b02018-03-08 22:03:5942#include "extensions/buildflags/buildflags.h"
[email protected]e4452d32013-11-15 23:07:4143#include "extensions/common/extension.h"
Devlin Cronin060876552020-01-06 22:20:3944#include "extensions/common/extension_id.h"
[email protected]289c44b2013-12-17 03:26:5745#include "extensions/common/extension_set.h"
[email protected]d42c11152013-08-22 19:36:3246#include "extensions/common/manifest.h"
[email protected]6014d672008-12-05 00:38:2547
brettw00899e62016-11-12 02:10:1748#if !BUILDFLAG(ENABLE_EXTENSIONS)
thestig44b9ce22014-10-17 03:19:2849#error "Extensions must be enabled"
50#endif
51
Devlin Cronineea1b7a2018-05-26 02:46:2152class BlacklistedExtensionSyncServiceTest;
mukai87a8d402014-09-15 20:15:0953class HostContentSettingsMap;
[email protected]81e63782009-02-27 19:35:0954class Profile;
[email protected]aa142702010-03-26 01:26:3355
[email protected]7f8f24f2012-11-15 19:40:1456namespace base {
[email protected]2f3b1cc2014-03-17 23:07:1557class CommandLine;
Christopher Lamebb90202019-04-04 03:42:3658class OneShotEvent;
[email protected]7f8f24f2012-11-15 19:40:1459}
60
Devlin Cronineea1b7a2018-05-26 02:46:2161FORWARD_DECLARE_TEST(BlacklistedExtensionSyncServiceTest,
62 SyncBlacklistedExtension);
63
[email protected]9c70e0d92012-07-16 08:39:4464namespace extensions {
ryanackley48bedbd2015-01-27 23:12:1465class AppDataMigrator;
[email protected]d8c8f25f2011-11-02 18:18:0166class ComponentLoader;
[email protected]bf3d9df2012-07-24 23:20:2767class CrxInstaller;
[email protected]c77f2352012-08-08 22:07:5868class ExtensionActionStorageManager;
[email protected]373daf972014-04-10 01:50:4469class ExtensionErrorController;
[email protected]bb1bc9b32013-12-21 03:09:1470class ExtensionRegistry;
[email protected]bd306722012-07-11 20:43:5971class ExtensionSystem;
[email protected]42a08162012-03-16 18:09:1172class ExtensionUpdater;
[email protected]2894a512014-06-26 19:03:5673class ExternalInstallManager;
[email protected]90878c52014-04-04 18:21:0274class SharedModuleService;
[email protected]a9aa62b312013-11-29 05:35:0675class UpdateObserver;
Devlin Croninc9c4efe2020-01-07 21:04:0576enum class UnloadedExtensionReason;
[email protected]163ed192012-07-24 19:31:0777
[email protected]d1ca0ed12009-07-01 18:24:3278// This is an interface class to encapsulate the dependencies that
[email protected]2859946f2011-04-04 18:18:0679// various classes have on ExtensionService. This allows easy mocking.
[email protected]f8aefb132013-10-30 09:29:5280class ExtensionServiceInterface
81 : public base::SupportsWeakPtr<ExtensionServiceInterface> {
[email protected]d1ca0ed12009-07-01 18:24:3282 public:
[email protected]2859946f2011-04-04 18:18:0683 virtual ~ExtensionServiceInterface() {}
[email protected]ca975942014-01-07 12:06:4784
[email protected]dccba4f82014-05-29 00:52:5685 // Gets the object managing the set of pending extensions.
Devlin Cronineea1b7a2018-05-26 02:46:2186 virtual PendingExtensionManager* pending_extension_manager() = 0;
[email protected]420a0ec2011-06-01 01:07:0387
[email protected]dccba4f82014-05-29 00:52:5688 // Installs an update with the contents from |extension_path|. Returns true if
89 // the install can be started. Sets |out_crx_installer| to the installer if
90 // one was started.
91 // TODO(aa): This method can be removed. ExtensionUpdater could use
92 // CrxInstaller directly instead.
Devlin Cronineea1b7a2018-05-26 02:46:2193 virtual bool UpdateExtension(const CRXFileInfo& file,
94 bool file_ownership_passed,
95 CrxInstaller** out_crx_installer) = 0;
[email protected]dccba4f82014-05-29 00:52:5696
[email protected]dccba4f82014-05-29 00:52:5697 // Returns an update for an extension with the specified id, if installation
98 // of that update was previously delayed because the extension was in use. If
99 // no updates are pending for the extension returns NULL.
Devlin Cronineea1b7a2018-05-26 02:46:21100 virtual const Extension* GetPendingExtensionUpdate(
[email protected]76b65442012-11-17 14:11:48101 const std::string& extension_id) const = 0;
[email protected]dccba4f82014-05-29 00:52:56102
Toni Barzic667db0d32018-01-09 18:00:19103 // Attempts finishing installation of an update for an extension with the
104 // specified id, when installation of that extension was previously delayed.
105 // |install_immediately| - Whether the extension should be installed if it's
106 // currently in use.
107 // Returns whether the extension installation was finished.
108 virtual bool FinishDelayedInstallationIfReady(const std::string& extension_id,
109 bool install_immediately) = 0;
[email protected]76b65442012-11-17 14:11:48110
[email protected]dccba4f82014-05-29 00:52:56111 // Returns true if the extension with the given |extension_id| is enabled.
mfoltz96f329c2016-01-13 18:16:58112 // This will only return a valid answer for installed extensions (regardless
113 // of whether it is currently loaded or not). Loaded extensions return true
114 // if they are currently loaded or terminated. Unloaded extensions will
115 // return true if they are not blocked, disabled, blacklisted or uninstalled
116 // (for external extensions).
[email protected]c3cfb012011-04-06 22:07:35117 virtual bool IsExtensionEnabled(const std::string& extension_id) const = 0;
[email protected]2859946f2011-04-04 18:18:06118
[email protected]dccba4f82014-05-29 00:52:56119 // Go through each extension and unload those that are not allowed to run by
120 // management policy providers (ie. network admin and Google-managed
121 // blacklist).
[email protected]4ee07c62012-08-21 12:40:42122 virtual void CheckManagementPolicy() = 0;
[email protected]5ef47ec2010-01-28 05:58:05123
[email protected]31206602011-04-13 23:07:32124 // Safe to call multiple times in a row.
125 //
[email protected]90310d92011-04-17 07:35:04126 // TODO(akalin): Remove this method (and others) once we refactor
127 // themes sync to not use it directly.
[email protected]31206602011-04-13 23:07:32128 virtual void CheckForUpdatesSoon() = 0;
[email protected]25ae0152011-11-18 14:40:02129
[email protected]dccba4f82014-05-29 00:52:56130 // Adds |extension| to this ExtensionService and notifies observers that the
Michael Giuffrida023e3532017-09-28 23:21:21131 // extension has been loaded.
Devlin Cronineea1b7a2018-05-26 02:46:21132 virtual void AddExtension(const Extension* extension) = 0;
[email protected]dccba4f82014-05-29 00:52:56133
134 // Check if we have preferences for the component extension and, if not or if
135 // the stored version differs, install the extension (without requirements
136 // checking) before calling AddExtension.
Devlin Cronineea1b7a2018-05-26 02:46:21137 virtual void AddComponentExtension(const Extension* extension) = 0;
[email protected]25ae0152011-11-18 14:40:02138
[email protected]dccba4f82014-05-29 00:52:56139 // Unload the specified extension.
limasdf0deef2042017-05-03 19:17:17140 virtual void UnloadExtension(const std::string& extension_id,
Devlin Cronineea1b7a2018-05-26 02:46:21141 UnloadedExtensionReason reason) = 0;
[email protected]dccba4f82014-05-29 00:52:56142
143 // Remove the specified component extension.
[email protected]8b1ec202013-09-05 02:09:50144 virtual void RemoveComponentExtension(const std::string& extension_id) = 0;
[email protected]25ae0152011-11-18 14:40:02145
[email protected]dccba4f82014-05-29 00:52:56146 // Whether the extension service is ready.
[email protected]25ae0152011-11-18 14:40:02147 virtual bool is_ready() = 0;
[email protected]d1ca0ed12009-07-01 18:24:32148};
[email protected]fbcc40302009-06-12 20:45:45149
[email protected]fafdc842014-01-17 18:09:08150// Manages installed and running Chromium extensions. An instance is shared
151// between normal and incognito profiles.
Devlin Cronineea1b7a2018-05-26 02:46:21152class ExtensionService : public ExtensionServiceInterface,
153 public ExternalProviderInterface::VisitorInterface,
154 public content::NotificationObserver,
155 public Blacklist::Observer,
156 public ExtensionManagement::Observer,
157 public UpgradeObserver,
Evan Staded89e11c2019-09-05 18:08:56158 public ExtensionRegistrar::Delegate,
159 public ProfileManagerObserver {
[email protected]4f313d52009-05-21 00:42:29160 public:
[email protected]73c47932010-12-06 18:13:43161 // Constructor stores pointers to |profile| and |extension_prefs| but
162 // ownership remains at caller.
[email protected]eaa7dd182010-12-14 11:09:00163 ExtensionService(Profile* profile,
[email protected]2f3b1cc2014-03-17 23:07:15164 const base::CommandLine* command_line,
[email protected]650b2d52013-02-10 03:41:45165 const base::FilePath& install_directory,
Devlin Cronineea1b7a2018-05-26 02:46:21166 ExtensionPrefs* extension_prefs,
167 Blacklist* blacklist,
[email protected]0436b102011-04-15 18:30:03168 bool autoupdate_enabled,
[email protected]4a10006a2013-05-17 23:18:35169 bool extensions_enabled,
Christopher Lamebb90202019-04-04 03:42:36170 base::OneShotEvent* ready);
[email protected]6014d672008-12-05 00:38:25171
dchengae36a4a2014-10-21 12:36:36172 ~ExtensionService() override;
[email protected]14908b72011-04-20 06:54:36173
[email protected]eb245382014-07-28 22:23:14174 // ExtensionServiceInterface implementation.
175 //
Devlin Cronineea1b7a2018-05-26 02:46:21176 PendingExtensionManager* pending_extension_manager() override;
Devlin Cronineea1b7a2018-05-26 02:46:21177 bool UpdateExtension(const CRXFileInfo& file,
dchengae36a4a2014-10-21 12:36:36178 bool file_ownership_passed,
Devlin Cronineea1b7a2018-05-26 02:46:21179 CrxInstaller** out_crx_installer) override;
dchengae36a4a2014-10-21 12:36:36180 bool IsExtensionEnabled(const std::string& extension_id) const override;
limasdf0deef2042017-05-03 19:17:17181 void UnloadExtension(const std::string& extension_id,
Devlin Cronineea1b7a2018-05-26 02:46:21182 UnloadedExtensionReason reason) override;
dchengae36a4a2014-10-21 12:36:36183 void RemoveComponentExtension(const std::string& extension_id) override;
Devlin Cronineea1b7a2018-05-26 02:46:21184 void AddExtension(const Extension* extension) override;
185 void AddComponentExtension(const Extension* extension) override;
186 const Extension* GetPendingExtensionUpdate(
mostynba15bee12014-10-04 00:40:32187 const std::string& extension_id) const override;
Toni Barzic667db0d32018-01-09 18:00:19188 bool FinishDelayedInstallationIfReady(const std::string& extension_id,
189 bool install_immediately) override;
dchengae36a4a2014-10-21 12:36:36190 void CheckManagementPolicy() override;
191 void CheckForUpdatesSoon() override;
192 bool is_ready() override;
[email protected]aa142702010-03-26 01:26:33193
lazyboye8634172016-01-28 00:10:48194 // ExternalProvider::VisitorInterface implementation.
[email protected]dccba4f82014-05-29 00:52:56195 // Exposed for testing.
lazyboye8634172016-01-28 00:10:48196 bool OnExternalExtensionFileFound(
Devlin Cronineea1b7a2018-05-26 02:46:21197 const ExternalInstallInfoFile& info) override;
dchengae36a4a2014-10-21 12:36:36198 bool OnExternalExtensionUpdateUrlFound(
Devlin Cronineea1b7a2018-05-26 02:46:21199 const ExternalInstallInfoUpdateUrl& info,
lazyboye8634172016-01-28 00:10:48200 bool is_initial_load) override;
dchengae36a4a2014-10-21 12:36:36201 void OnExternalProviderReady(
Devlin Cronineea1b7a2018-05-26 02:46:21202 const ExternalProviderInterface* provider) override;
lazyboye8634172016-01-28 00:10:48203 void OnExternalProviderUpdateComplete(
Devlin Cronineea1b7a2018-05-26 02:46:21204 const ExternalProviderInterface* provider,
205 const std::vector<ExternalInstallInfoUpdateUrl>&
lazyboye8634172016-01-28 00:10:48206 external_update_url_extensions,
Devlin Cronineea1b7a2018-05-26 02:46:21207 const std::vector<ExternalInstallInfoFile>& external_file_extensions,
lazyboye8634172016-01-28 00:10:48208 const std::set<std::string>& removed_extensions) override;
[email protected]ec5b50d2010-10-09 16:35:18209
binjin1569c9b2014-09-05 13:33:18210 // ExtensionManagement::Observer implementation:
dchengae36a4a2014-10-21 12:36:36211 void OnExtensionManagementSettingsChanged() override;
binjin1569c9b2014-09-05 13:33:18212
[email protected]6014d672008-12-05 00:38:25213 // Initialize and start all installed extensions.
[email protected]9f1087e2009-06-15 17:29:32214 void Init();
[email protected]6014d672008-12-05 00:38:25215
[email protected]47b896562012-08-22 23:55:15216 // Called when the associated Profile is going to be destroyed.
217 void Shutdown();
218
[email protected]2380c6b2013-01-09 02:33:13219 // Reloads the specified extension, sending the onLaunched() event to it if it
220 // currently has any window showing.
[email protected]bca4b832014-07-17 20:22:34221 // Allows noisy failures.
thestig7b4bd932014-09-09 22:44:31222 // NOTE: Reloading an extension can invalidate |extension_id| and Extension
223 // pointers for the given extension. Consider making a copy of |extension_id|
224 // first and retrieving a new Extension pointer afterwards.
[email protected]757d60a2014-05-23 00:11:44225 void ReloadExtension(const std::string& extension_id);
[email protected]9cddd4702009-07-27 22:09:40226
[email protected]bca4b832014-07-17 20:22:34227 // Suppresses noisy failures.
228 void ReloadExtensionWithQuietFailure(const std::string& extension_id);
229
[email protected]631cf822009-05-15 07:01:25230 // Uninstalls the specified extension. Callers should only call this method
[email protected]cc2f55c2014-07-08 02:19:04231 // with extensions that exist. |reason| lets the caller specify why the
232 // extension is uninstalled.
Devlin Cronin218df7f2017-11-21 21:41:31233 // Note: this method synchronously removes the extension from the
234 // set of installed extensions stored in the ExtensionRegistry, but will
235 // asynchronously remove site-related data and the files stored on disk.
236 // Returns true if an uninstall was successfully triggered; this can fail if
237 // the extension cannot be uninstalled (such as a policy force-installed
238 // extension).
Devlin Croninad24e5b2017-11-29 00:54:43239 bool UninstallExtension(const std::string& extension_id,
Devlin Cronineea1b7a2018-05-26 02:46:21240 UninstallReason reason,
Devlin Croninad24e5b2017-11-29 00:54:43241 base::string16* error);
[email protected]631cf822009-05-15 07:01:25242
[email protected]06f92562011-04-29 19:27:31243 // Enables the extension. If the extension is already enabled, does
244 // nothing.
Devlin Croninad24e5b2017-11-29 00:54:43245 void EnableExtension(const std::string& extension_id);
[email protected]06f92562011-04-29 19:27:31246
treibc1192322015-05-20 12:56:07247 // Disables the extension. If the extension is already disabled, just adds
Minh X. Nguyen45479012017-08-18 21:35:36248 // the |disable_reasons| (a bitmask of disable_reason::DisableReason - there
249 // can be multiple DisableReasons e.g. when an extension comes in disabled
250 // from Sync). If the extension cannot be disabled (due to policy), does
251 // nothing.
Devlin Croninad24e5b2017-11-29 00:54:43252 void DisableExtension(const std::string& extension_id, int disable_reasons);
[email protected]0c6da502009-08-14 22:32:39253
Ivan Sandrk4a55dc22018-05-17 18:14:48254 // Same as |DisableExtension|, but assumes that the request to disable
255 // |extension_id| originates from |source_extension| when evaluating whether
256 // the extension can be disabled. Please see |ExtensionMayModifySettings|
257 // for details.
258 void DisableExtensionWithSource(
Devlin Cronineea1b7a2018-05-26 02:46:21259 const Extension* source_extension,
Ivan Sandrk4a55dc22018-05-17 18:14:48260 const std::string& extension_id,
Devlin Cronineea1b7a2018-05-26 02:46:21261 disable_reason::DisableReason disable_reasons);
Ivan Sandrk4a55dc22018-05-17 18:14:48262
[email protected]3082fe32013-08-06 11:12:38263 // Disable non-default and non-managed extensions with ids not in
264 // |except_ids|. Default extensions are those from the Web Store with
265 // |was_installed_by_default| flag.
mtomasz294bb3e2017-01-24 02:17:52266 void DisableUserExtensionsExcept(const std::vector<std::string>& except_ids);
[email protected]e516e4c2013-06-12 17:41:14267
mlerman6a37b6a42014-11-26 22:10:53268 // Puts all extensions in a blocked state: Unloading every extension, and
269 // preventing them from ever loading until UnblockAllExtensions is called.
270 // This state is stored in preferences, so persists until Chrome restarts.
271 //
272 // Component, external component and whitelisted policy installed extensions
Michael Giuffrida6397c592017-10-09 20:46:53273 // are exempt from being Blocked (see CanBlockExtension in .cc file).
mlerman6a37b6a42014-11-26 22:10:53274 void BlockAllExtensions();
275
276 // All blocked extensions are reverted to their previous state, and are
277 // reloaded. Newly added extensions are no longer automatically blocked.
278 void UnblockAllExtensions();
279
[email protected]8d888c12010-11-30 00:00:25280 // Updates the |extension|'s granted permissions lists to include all
[email protected]8d888c12010-11-30 00:00:25281 // permissions in the |extension|'s manifest and re-enables the
282 // extension.
Devlin Cronineea1b7a2018-05-26 02:46:21283 void GrantPermissionsAndEnableExtension(const Extension* extension);
[email protected]8d888c12010-11-30 00:00:25284
[email protected]be083862012-09-01 03:53:45285 // Updates the |extension|'s granted permissions lists to include all
286 // permissions in the |extensions|'s manifest.
Devlin Cronineea1b7a2018-05-26 02:46:21287 void GrantPermissions(const Extension* extension);
[email protected]be083862012-09-01 03:53:45288
[email protected]9f1087e2009-06-15 17:29:32289 // Check for updates (or potentially new extensions from external providers)
[email protected]93fd78f42009-07-10 16:43:17290 void CheckForExternalUpdates();
[email protected]9f1087e2009-06-15 17:29:32291
[email protected]bc151cf92013-02-12 04:57:26292 // Informs the service that an extension's files are in place for loading.
293 //
Karandeep Bhatiaa8930652017-10-11 17:41:12294 // |extension| the extension
295 // |page_ordinal| the location of the extension in the app launcher
Devlin Cronineea1b7a2018-05-26 02:46:21296 // |install_flags| a bitmask of InstallFlags
Karandeep Bhatiaa8930652017-10-11 17:41:12297 // |dnr_ruleset_checksum| Checksum of the indexed ruleset for the Declarative
298 // Net Request API.
299 void OnExtensionInstalled(
Devlin Cronineea1b7a2018-05-26 02:46:21300 const Extension* extension,
Karandeep Bhatiaa8930652017-10-11 17:41:12301 const syncer::StringOrdinal& page_ordinal,
302 int install_flags,
303 const base::Optional<int>& dnr_ruleset_checksum = base::nullopt);
Devlin Cronineea1b7a2018-05-26 02:46:21304 void OnExtensionInstalled(const Extension* extension,
[email protected]4a1d9c0d2014-06-13 12:50:11305 const syncer::StringOrdinal& page_ordinal) {
Devlin Cronineea1b7a2018-05-26 02:46:21306 OnExtensionInstalled(extension, page_ordinal,
307 static_cast<int>(kInstallFlagNone));
[email protected]4a1d9c0d2014-06-13 12:50:11308 }
[email protected]0db124b02012-11-07 04:55:05309
[email protected]9f4e4f082013-06-21 07:11:19310 // Checks for delayed installation for all pending installs.
311 void MaybeFinishDelayedInstallations();
312
[email protected]406027c02010-09-27 08:03:18313 // ExtensionHost of background page calls this method right after its render
314 // view has been created.
Devlin Cronineea1b7a2018-05-26 02:46:21315 void DidCreateRenderViewForBackgroundPage(ExtensionHost* host);
[email protected]406027c02010-09-27 08:03:18316
[email protected]fe2dd7742011-04-19 22:52:49317 // Record a histogram using the PermissionMessage enum values for each
318 // permission in |e|.
319 // NOTE: If this is ever called with high frequency, the implementation may
320 // need to be made more efficient.
Devlin Cronineea1b7a2018-05-26 02:46:21321 static void RecordPermissionMessagesHistogram(const Extension* extension,
322 const char* histogram);
[email protected]fe2dd7742011-04-19 22:52:49323
Michael Giuffridafcb420362017-10-11 21:50:26324 // Unloads the given extension and marks the extension as terminated. This
[email protected]e9d7496e2014-04-18 01:25:46325 // doesn't notify the user that the extension was terminated, if such a
326 // notification is desired the calling code is responsible for doing that.
327 void TerminateExtension(const std::string& extension_id);
328
mukai87a8d402014-09-15 20:15:09329 // Register self and content settings API with the specified map.
mmenkead5094ab2017-05-15 19:01:14330 static void RegisterContentSettings(
331 HostContentSettingsMap* host_content_settings_map,
332 Profile* profile);
mukai87a8d402014-09-15 20:15:09333
[email protected]dccba4f82014-05-29 00:52:56334 // Adds/Removes update observers.
Devlin Cronineea1b7a2018-05-26 02:46:21335 void AddUpdateObserver(UpdateObserver* observer);
336 void RemoveUpdateObserver(UpdateObserver* observer);
[email protected]a51c9e92012-12-09 09:19:20337
xiyuanf6a4c6a62016-04-19 18:14:54338 // Register/unregister an InstallGate with the service.
Devlin Cronineea1b7a2018-05-26 02:46:21339 void RegisterInstallGate(ExtensionPrefs::DelayReason reason,
340 InstallGate* install_delayer);
341 void UnregisterInstallGate(InstallGate* install_delayer);
xiyuanf6a4c6a62016-04-19 18:14:54342
[email protected]dccba4f82014-05-29 00:52:56343 //////////////////////////////////////////////////////////////////////////////
344 // Simple Accessors
[email protected]fa2416f2011-05-03 08:41:20345
[email protected]dccba4f82014-05-29 00:52:56346 // Returns a WeakPtr to the ExtensionService.
[email protected]77e4dc0882012-06-20 18:53:50347 base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); }
348
[email protected]dccba4f82014-05-29 00:52:56349 // Returns profile_ as a BrowserContext.
350 content::BrowserContext* GetBrowserContext() const;
351
352 bool extensions_enabled() const { return extensions_enabled_; }
[email protected]dccba4f82014-05-29 00:52:56353
354 const base::FilePath& install_directory() const { return install_directory_; }
355
Devlin Cronineea1b7a2018-05-26 02:46:21356 const ExtensionSet* delayed_installs() const { return &delayed_installs_; }
[email protected]dccba4f82014-05-29 00:52:56357
[email protected]dccba4f82014-05-29 00:52:56358 Profile* profile() { return profile_; }
359
[email protected]dccba4f82014-05-29 00:52:56360 // Note that this may return NULL if autoupdate is not turned on.
Devlin Cronineea1b7a2018-05-26 02:46:21361 ExtensionUpdater* updater() { return updater_.get(); }
[email protected]dccba4f82014-05-29 00:52:56362
Devlin Cronineea1b7a2018-05-26 02:46:21363 ComponentLoader* component_loader() { return component_loader_.get(); }
[email protected]dccba4f82014-05-29 00:52:56364
[email protected]3c4abc82012-10-22 22:25:54365 bool browser_terminating() const { return browser_terminating_; }
366
Devlin Cronineea1b7a2018-05-26 02:46:21367 SharedModuleService* shared_module_service() {
[email protected]90878c52014-04-04 18:21:02368 return shared_module_service_.get();
369 }
370
Devlin Cronineea1b7a2018-05-26 02:46:21371 ExternalInstallManager* external_install_manager() {
[email protected]2894a512014-06-26 19:03:56372 return external_install_manager_.get();
373 }
374
[email protected]dccba4f82014-05-29 00:52:56375 //////////////////////////////////////////////////////////////////////////////
376 // For Testing
377
378 // Unload all extensions. Does not send notifications.
379 void UnloadAllExtensionsForTest();
380
381 // Reloads all extensions. Does not notify that extensions are ready.
382 void ReloadExtensionsForTest();
383
384 // Clear all ExternalProviders.
385 void ClearProvidersForTesting();
386
387 // Adds an ExternalProviderInterface for the service to use during testing.
[email protected]dccba4f82014-05-29 00:52:56388 void AddProviderForTesting(
Devlin Cronineea1b7a2018-05-26 02:46:21389 std::unique_ptr<ExternalProviderInterface> test_provider);
[email protected]dccba4f82014-05-29 00:52:56390
[email protected]8f959f522014-08-06 06:26:28391 // Simulate an extension being blacklisted for tests.
392 void BlacklistExtensionForTest(const std::string& extension_id);
393
[email protected]dccba4f82014-05-29 00:52:56394#if defined(UNIT_TEST)
Devlin Cronineea1b7a2018-05-26 02:46:21395 void FinishInstallationForTest(const Extension* extension) {
benwells1dd4acd2015-12-09 02:20:24396 FinishInstallation(extension);
[email protected]dccba4f82014-05-29 00:52:56397 }
Takumi Fujimoto43c8c00f2017-07-26 22:48:56398
399 void UninstallMigratedExtensionsForTest() { UninstallMigratedExtensions(); }
[email protected]dccba4f82014-05-29 00:52:56400#endif
401
[email protected]3c4abc82012-10-22 22:25:54402 void set_browser_terminating_for_test(bool value) {
403 browser_terminating_ = value;
404 }
405
[email protected]4e9b59d2013-12-18 06:47:14406 // Set a callback to be called when all external providers are ready and their
407 // extensions have been installed.
408 void set_external_updates_finished_callback_for_test(
409 const base::Closure& callback) {
410 external_updates_finished_callback_ = callback;
411 }
412
lazyboy77214d3c2017-04-04 16:46:12413 void set_external_updates_disabled_for_test(bool value) {
414 external_updates_disabled_for_test_ = value;
415 }
416
[email protected]14908b72011-04-20 06:54:36417 private:
catmullings98cd1942016-08-30 22:31:59418 // Loads extensions specified via a command line flag/switch.
419 void LoadExtensionsFromCommandLineFlag(const char* switch_name);
420
[email protected]dccba4f82014-05-29 00:52:56421 // content::NotificationObserver implementation:
dchengae36a4a2014-10-21 12:36:36422 void Observe(int type,
423 const content::NotificationSource& source,
424 const content::NotificationDetails& details) override;
[email protected]dccba4f82014-05-29 00:52:56425
Devlin Cronineea1b7a2018-05-26 02:46:21426 // Blacklist::Observer implementation.
dchengae36a4a2014-10-21 12:36:36427 void OnBlacklistUpdated() override;
[email protected]dccba4f82014-05-29 00:52:56428
weidongg04695232017-06-09 00:01:05429 // UpgradeObserver implementation.
430 void OnUpgradeRecommended() override;
431
Devlin Cronineea1b7a2018-05-26 02:46:21432 // ExtensionRegistrar::Delegate implementation.
433 void PreAddExtension(const Extension* extension,
434 const Extension* old_extension) override;
435 void PostActivateExtension(scoped_refptr<const Extension> extension) override;
Michael Giuffrida6397c592017-10-09 20:46:53436 void PostDeactivateExtension(
Devlin Cronineea1b7a2018-05-26 02:46:21437 scoped_refptr<const Extension> extension) override;
438 void LoadExtensionForReload(
439 const ExtensionId& extension_id,
440 const base::FilePath& path,
441 ExtensionRegistrar::LoadErrorBehavior load_error_behavior) override;
442 bool CanEnableExtension(const Extension* extension) override;
443 bool CanDisableExtension(const Extension* extension) override;
444 bool ShouldBlockExtension(const Extension* extension) override;
Michael Giuffrida6397c592017-10-09 20:46:53445
Evan Staded89e11c2019-09-05 18:08:56446 // ProfileManagerObserver implementation.
447 void OnProfileMarkedForPermanentDeletion(Profile* profile) override;
448
[email protected]dccba4f82014-05-29 00:52:56449 // For the extension in |version_path| with |id|, check to see if it's an
450 // externally managed extension. If so, uninstall it.
451 void CheckExternalUninstall(const std::string& id);
452
rkaplowa8fd8d32015-02-25 21:27:56453 // Attempt to enable all disabled extensions which the only disabled reason is
454 // reloading.
455 void EnabledReloadableExtensions();
456
457 // Finish install (if possible) of extensions that were still delayed while
458 // the browser was shut down.
459 void MaybeFinishShutdownDelayed();
460
[email protected]2d19eb6e2014-01-27 17:30:00461 // Populates greylist_.
462 void LoadGreylistFromPrefs();
463
[email protected]4a10006a2013-05-17 23:18:35464 // Signals *ready_ and sends a notification to the listeners.
[email protected]820d9bd2013-04-03 03:46:03465 void SetReadyAndNotifyListeners();
466
[email protected]dccba4f82014-05-29 00:52:56467 // Returns true if all the external extension providers are ready.
468 bool AreAllExternalProvidersReady() const;
469
470 // Called once all external providers are ready. Checks for unclaimed
471 // external extensions.
472 void OnAllExternalProvidersReady();
473
[email protected]8c484b742012-11-29 06:05:36474 // Update preferences for a new or updated extension; notify observers that
475 // the extension is installed, e.g., to update event handlers on background
476 // pages; and perform other extension install tasks before calling
477 // AddExtension.
Devlin Cronineea1b7a2018-05-26 02:46:21478 // |install_flags| is a bitmask of InstallFlags.
Karandeep Bhatiaa8930652017-10-11 17:41:12479 void AddNewOrUpdatedExtension(
Devlin Cronineea1b7a2018-05-26 02:46:21480 const Extension* extension,
481 Extension::State initial_state,
Karandeep Bhatiaa8930652017-10-11 17:41:12482 int install_flags,
483 const syncer::StringOrdinal& page_ordinal,
484 const std::string& install_parameter,
485 const base::Optional<int>& dnr_ruleset_checksum);
[email protected]8c484b742012-11-29 06:05:36486
benwells1dd4acd2015-12-09 02:20:24487 // Common helper to finish installing the given extension.
Devlin Cronineea1b7a2018-05-26 02:46:21488 void FinishInstallation(const Extension* extension);
[email protected]6f6101832012-11-27 22:10:48489
Marc Grimmeefba8d22020-01-09 07:57:25490 // Sets the policy settings for the extension basically
491 // by delegating this to the permission_data_updater.
492 // Holds for default and policy settings.
493 void SetPolicySettingsForExtension(const Extension* extension);
494
[email protected]b914e2952013-04-26 07:10:03495 // Disables the extension if the privilege level has increased
496 // (e.g., due to an upgrade).
Devlin Cronineea1b7a2018-05-26 02:46:21497 void CheckPermissionsIncrease(const Extension* extension,
treib6e51bca2016-06-15 10:26:03498 bool is_extension_loaded);
[email protected]b914e2952013-04-26 07:10:03499
[email protected]aab98a52009-12-02 03:22:35500 // Helper that updates the active extension list used for crash reporting.
501 void UpdateActiveExtensionsInCrashReporter();
502
binjin47947f842014-11-18 12:10:24503 // Helper to get the disable reasons for an installed (or upgraded) extension.
Minh X. Nguyen45479012017-08-18 21:35:36504 // A return value of disable_reason::DISABLE_NONE indicates that we should
505 // enable this extension initially.
Devlin Cronineea1b7a2018-05-26 02:46:21506 int GetDisableReasonsOnInstalled(const Extension* extension);
[email protected]612a1cb12012-10-17 13:18:03507
mlerman6a37b6a42014-11-26 22:10:53508 // Helper method to determine if an extension can be blocked.
Devlin Cronineea1b7a2018-05-26 02:46:21509 bool CanBlockExtension(const Extension* extension) const;
mlerman6a37b6a42014-11-26 22:10:53510
xiyuanf6a4c6a62016-04-19 18:14:54511 // Helper to determine if installing an extensions should proceed immediately,
512 // or if we should delay the install until further notice, or if the install
513 // should be aborted. A pending install is delayed or aborted when any of the
514 // delayers say so and only proceeds when all delayers return INSTALL.
515 // |extension| is the extension to be installed. |install_immediately| is the
516 // install flag set with the install. |reason| is the reason associated with
517 // the install delayer that wants to defer or abort the install.
Devlin Cronineea1b7a2018-05-26 02:46:21518 InstallGate::Action ShouldDelayExtensionInstall(
519 const Extension* extension,
xiyuanf6a4c6a62016-04-19 18:14:54520 bool install_immediately,
Devlin Cronineea1b7a2018-05-26 02:46:21521 ExtensionPrefs::DelayReason* reason) const;
[email protected]e7aa7b7e2012-11-27 04:51:22522
[email protected]695b5712012-12-06 23:55:28523 // Manages the blacklisted extensions, intended as callback from
524 // Blacklist::GetBlacklistedIDs.
Devlin Cronineea1b7a2018-05-26 02:46:21525 void ManageBlacklist(const Blacklist::BlacklistStateMap& blacklisted_ids);
[email protected]2d19eb6e2014-01-27 17:30:00526
mlerman6a37b6a42014-11-26 22:10:53527 // Add extensions in |blacklisted| to blacklisted_extensions, remove
528 // extensions that are neither in |blacklisted|, nor in |unchanged|.
Devlin Cronineea1b7a2018-05-26 02:46:21529 void UpdateBlacklistedExtensions(const ExtensionIdSet& to_blacklist,
530 const ExtensionIdSet& unchanged);
[email protected]2d19eb6e2014-01-27 17:30:00531
532 void UpdateGreylistedExtensions(
Devlin Cronineea1b7a2018-05-26 02:46:21533 const ExtensionIdSet& greylist,
534 const ExtensionIdSet& unchanged,
535 const Blacklist::BlacklistStateMap& state_map);
[email protected]695b5712012-12-06 23:55:28536
[email protected]bb1bc9b32013-12-21 03:09:14537 // Used only by test code.
538 void UnloadAllExtensionsInternal();
539
[email protected]ebe07772014-05-22 04:16:06540 // Disable apps & extensions now to stop them from running after a profile
541 // has been conceptually deleted. Don't wait for full browser shutdown and
542 // the actual profile objects to be destroyed.
543 void OnProfileDestructionStarted();
544
[email protected]5a145e82014-05-29 22:19:07545 // Called on file task runner thread to uninstall extension.
546 static void UninstallExtensionOnFileThread(
547 const std::string& id,
548 Profile* profile,
549 const base::FilePath& install_dir,
550 const base::FilePath& extension_path);
551
rdevlin.croninf2e1cb012017-05-27 01:27:59552 // Called when the initial extensions load has completed.
553 void OnInstalledExtensionsLoaded();
554
Takumi Fujimoto43c8c00f2017-07-26 22:48:56555 // Uninstall extensions that have been migrated to component extensions.
556 void UninstallMigratedExtensions();
557
catmullings98cd1942016-08-30 22:31:59558 const base::CommandLine* command_line_ = nullptr;
559
[email protected]31d8f5f22012-04-02 15:22:08560 // The normal profile associated with this ExtensionService.
achuith2f5578b2016-02-26 21:57:13561 Profile* profile_ = nullptr;
[email protected]6ef635e42009-07-26 06:16:12562
[email protected]31d8f5f22012-04-02 15:22:08563 // The ExtensionSystem for the profile above.
Devlin Cronineea1b7a2018-05-26 02:46:21564 ExtensionSystem* system_ = nullptr;
[email protected]31d8f5f22012-04-02 15:22:08565
[email protected]695b5712012-12-06 23:55:28566 // Preferences for the owning profile.
Devlin Cronineea1b7a2018-05-26 02:46:21567 ExtensionPrefs* extension_prefs_ = nullptr;
[email protected]894bb502009-05-21 22:39:57568
[email protected]695b5712012-12-06 23:55:28569 // Blacklist for the owning profile.
Devlin Cronineea1b7a2018-05-26 02:46:21570 Blacklist* blacklist_ = nullptr;
[email protected]695b5712012-12-06 23:55:28571
[email protected]5fdfa562013-12-27 17:43:59572 // Sets of enabled/disabled/terminated/blacklisted extensions. Not owned.
Devlin Cronineea1b7a2018-05-26 02:46:21573 ExtensionRegistry* registry_ = nullptr;
[email protected]695b5712012-12-06 23:55:28574
[email protected]2d19eb6e2014-01-27 17:30:00575 // Set of greylisted extensions. These extensions are disabled if they are
576 // already installed in Chromium at the time when they are added to
577 // the greylist. Unlike blacklisted extensions, greylisted ones are visible
578 // to the user and if user re-enables such an extension, they remain enabled.
579 //
580 // These extensions should appear in registry_.
Devlin Cronineea1b7a2018-05-26 02:46:21581 ExtensionSet greylist_;
[email protected]2d19eb6e2014-01-27 17:30:00582
catmullings98cd1942016-08-30 22:31:59583 // Set of whitelisted enabled extensions loaded from the
584 // --disable-extensions-except command line flag.
585 std::set<std::string> disable_flag_exempted_extensions_;
586
[email protected]9f4e4f082013-06-21 07:11:19587 // The list of extension installs delayed for various reasons. The reason
[email protected]bb1bc9b32013-12-21 03:09:14588 // for delayed install is stored in ExtensionPrefs. These are not part of
589 // ExtensionRegistry because they are not yet installed.
Devlin Cronineea1b7a2018-05-26 02:46:21590 ExtensionSet delayed_installs_;
[email protected]0db124b02012-11-07 04:55:05591
[email protected]b2907fd2011-03-25 16:43:37592 // Hold the set of pending extensions.
Devlin Cronineea1b7a2018-05-26 02:46:21593 PendingExtensionManager pending_extension_manager_;
[email protected]aa142702010-03-26 01:26:33594
[email protected]6014d672008-12-05 00:38:25595 // The full path to the directory where extensions are installed.
[email protected]650b2d52013-02-10 03:41:45596 base::FilePath install_directory_;
[email protected]6014d672008-12-05 00:38:25597
[email protected]e2eb43112009-05-29 21:19:54598 // Whether or not extensions are enabled.
achuith2f5578b2016-02-26 21:57:13599 bool extensions_enabled_ = true;
[email protected]e2eb43112009-05-29 21:19:54600
[email protected]4a10006a2013-05-17 23:18:35601 // Signaled when all extensions are loaded.
Christopher Lamebb90202019-04-04 03:42:36602 base::OneShotEvent* const ready_;
[email protected]e81dba32009-06-19 20:19:13603
[email protected]93fd78f42009-07-10 16:43:17604 // Our extension updater, if updates are turned on.
Devlin Cronineea1b7a2018-05-26 02:46:21605 std::unique_ptr<ExtensionUpdater> updater_;
[email protected]93fd78f42009-07-10 16:43:17606
[email protected]6c2381d2011-10-19 02:52:53607 content::NotificationRegistrar registrar_;
[email protected]4814b512009-11-07 00:12:29608
[email protected]d8c8f25f2011-11-02 18:18:01609 // Keeps track of loading and unloading component extensions.
Devlin Cronineea1b7a2018-05-26 02:46:21610 std::unique_ptr<ComponentLoader> component_loader_;
[email protected]d8c8f25f2011-11-02 18:18:01611
[email protected]8e4560b62011-01-14 10:09:14612 // A collection of external extension providers. Each provider reads
613 // a source of external extension information. Examples include the
614 // windows registry and external_extensions.json.
Devlin Cronineea1b7a2018-05-26 02:46:21615 ProviderCollection external_extension_providers_;
[email protected]8e4560b62011-01-14 10:09:14616
617 // Set to true by OnExternalExtensionUpdateUrlFound() when an external
[email protected]94fde232012-04-27 10:22:30618 // extension URL is found, and by CheckForUpdatesSoon() when an update check
619 // has to wait for the external providers. Used in
620 // OnAllExternalProvidersReady() to determine if an update check is needed to
621 // install pending extensions.
achuith2f5578b2016-02-26 21:57:13622 bool update_once_all_providers_are_ready_ = false;
[email protected]8e4560b62011-01-14 10:09:14623
[email protected]4e9b59d2013-12-18 06:47:14624 // A callback to be called when all external providers are ready and their
625 // extensions have been installed. Normally this is a null callback, but
626 // is used in external provider related tests.
Minh X. Nguyen722b9682018-04-25 21:46:48627 // TODO(mxnguyen): Change |external_updates_finished_callback_| to
628 // OnceClosure.
[email protected]4e9b59d2013-12-18 06:47:14629 base::Closure external_updates_finished_callback_;
630
[email protected]3c4abc82012-10-22 22:25:54631 // Set when the browser is terminating. Prevents us from installing or
632 // updating additional extensions and allows in-progress installations to
633 // decide to abort.
achuith2f5578b2016-02-26 21:57:13634 bool browser_terminating_ = false;
[email protected]3c4abc82012-10-22 22:25:54635
lazyboy77214d3c2017-04-04 16:46:12636 // If set, call to CheckForExternalUpdates() will bail out.
637 bool external_updates_disabled_for_test_ = false;
638
[email protected]460c6712013-04-24 07:20:01639 // Set to true if this is the first time this ExtensionService has run.
640 // Used for specially handling external extensions that are installed the
641 // first time.
achuith2f5578b2016-02-26 21:57:13642 bool is_first_run_ = false;
[email protected]460c6712013-04-24 07:20:01643
mlerman6a37b6a42014-11-26 22:10:53644 // Set to true if extensions are all to be blocked.
achuith2f5578b2016-02-26 21:57:13645 bool block_extensions_ = false;
mlerman6a37b6a42014-11-26 22:10:53646
[email protected]373daf972014-04-10 01:50:44647 // The controller for the UI that alerts the user about any blacklisted
648 // extensions.
Devlin Cronineea1b7a2018-05-26 02:46:21649 std::unique_ptr<ExtensionErrorController> error_controller_;
[email protected]373daf972014-04-10 01:50:44650
[email protected]2894a512014-06-26 19:03:56651 // The manager for extensions that were externally installed that is
652 // responsible for prompting the user about suspicious extensions.
Devlin Cronineea1b7a2018-05-26 02:46:21653 std::unique_ptr<ExternalInstallManager> external_install_manager_;
[email protected]2894a512014-06-26 19:03:56654
Devlin Cronineea1b7a2018-05-26 02:46:21655 std::unique_ptr<ExtensionActionStorageManager>
[email protected]c77f2352012-08-08 22:07:58656 extension_action_storage_manager_;
657
[email protected]90878c52014-04-04 18:21:02658 // The SharedModuleService used to check for import dependencies.
Devlin Cronineea1b7a2018-05-26 02:46:21659 std::unique_ptr<SharedModuleService> shared_module_service_;
[email protected]90878c52014-04-04 18:21:02660
Trent Apteda250ec3ab2018-08-19 08:52:19661 base::ObserverList<UpdateObserver, true>::Unchecked update_observers_;
[email protected]efdb7f1a2014-03-28 20:43:38662
ryanackley48bedbd2015-01-27 23:12:14663 // Migrates app data when upgrading a legacy packaged app to a platform app
Devlin Cronineea1b7a2018-05-26 02:46:21664 std::unique_ptr<AppDataMigrator> app_data_migrator_;
ryanackley48bedbd2015-01-27 23:12:14665
Michael Giuffrida023e3532017-09-28 23:21:21666 // Helper to register and unregister extensions.
Devlin Cronineea1b7a2018-05-26 02:46:21667 ExtensionRegistrar extension_registrar_;
Michael Giuffrida023e3532017-09-28 23:21:21668
Sergey Poromov0360b9e72018-04-19 17:37:29669 // Tracker of enterprise policy forced installation.
Devlin Cronineea1b7a2018-05-26 02:46:21670 InstallationTracker forced_extensions_tracker_;
Sergey Poromov0360b9e72018-04-19 17:37:29671
Evan Staded89e11c2019-09-05 18:08:56672 ScopedObserver<ProfileManager, ProfileManagerObserver>
673 profile_manager_observer_{this};
674
Devlin Cronineea1b7a2018-05-26 02:46:21675 using InstallGateRegistry =
676 std::map<ExtensionPrefs::DelayReason, InstallGate*>;
xiyuanf6a4c6a62016-04-19 18:14:54677 InstallGateRegistry install_delayer_registry_;
678
[email protected]eaa7dd182010-12-14 11:09:00679 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
[email protected]dccba4f82014-05-29 00:52:56680 DestroyingProfileClearsExtensions);
[email protected]f71b582c2014-01-10 17:03:15681 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs);
682 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
683 BlacklistedExtensionWillNotInstall);
684 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
685 UnloadBlacklistedExtensionPolicy);
686 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
687 WillNotLoadBlacklistedExtensionsFromDirectory);
[email protected]757d60a2014-05-23 00:11:44688 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ReloadBlacklistedExtension);
atuchin6dc7c442016-07-20 07:04:34689 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
690 RemoveExtensionFromBlacklist);
[email protected]757d60a2014-05-23 00:11:44691 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, BlacklistedInPrefsFromStartup);
[email protected]2d19eb6e2014-01-27 17:30:00692 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
693 GreylistedExtensionDisabled);
694 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
695 GreylistDontEnableManuallyDisabled);
696 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
697 GreylistUnknownDontChange);
binjin47947f842014-11-18 12:10:24698 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
699 ManagementPolicyProhibitsEnableOnInstalled);
mlerman6a37b6a42014-11-26 22:10:53700 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
701 BlockAndUnblockBlacklistedExtension);
Devlin Cronineea1b7a2018-05-26 02:46:21702 FRIEND_TEST_ALL_PREFIXES(::BlacklistedExtensionSyncServiceTest,
proberge901ecab2017-08-31 19:24:28703 SyncBlacklistedExtension);
Devlin Cronineea1b7a2018-05-26 02:46:21704 friend class ::BlacklistedExtensionSyncServiceTest;
[email protected]dccba4f82014-05-29 00:52:56705
[email protected]eaa7dd182010-12-14 11:09:00706 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
[email protected]6014d672008-12-05 00:38:25707};
708
Devlin Cronineea1b7a2018-05-26 02:46:21709} // namespace extensions
710
[email protected]eaa7dd182010-12-14 11:09:00711#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_