| Index: chrome/browser/extensions/extension_service.h
|
| diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h
|
| index 21c4a575c4020ecc46610abe2ec30c5cfb490726..7849762b3f7dcd85781338fe668c88d7d9188748 100644
|
| --- a/chrome/browser/extensions/extension_service.h
|
| +++ b/chrome/browser/extensions/extension_service.h
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -26,7 +26,7 @@
|
| #include "chrome/browser/extensions/extension_process_manager.h"
|
| #include "chrome/browser/extensions/extension_toolbar_model.h"
|
| #include "chrome/browser/extensions/extensions_quota_service.h"
|
| -#include "chrome/browser/extensions/external_extension_provider.h"
|
| +#include "chrome/browser/extensions/external_extension_provider_interface.h"
|
| #include "chrome/browser/extensions/sandboxed_extension_unpacker.h"
|
| #include "chrome/browser/prefs/pref_change_registrar.h"
|
| #include "chrome/common/notification_observer.h"
|
| @@ -99,6 +99,7 @@ class ExtensionService
|
| : public base::RefCountedThreadSafe<ExtensionService,
|
| BrowserThread::DeleteOnUIThread>,
|
| public ExtensionUpdateService,
|
| + public ExternalExtensionProviderInterface::VisitorInterface,
|
| public NotificationObserver {
|
| public:
|
| // Information about a registered component extension.
|
| @@ -298,10 +299,6 @@ class ExtensionService
|
| // Check for updates (or potentially new extensions from external providers)
|
| void CheckForExternalUpdates();
|
|
|
| - // Copies the list of force-installed extensions from the user PrefService
|
| - // to ExternalPolicyExtensionProvider.
|
| - void UpdateExternalPolicyExtensionProvider();
|
| -
|
| // Unload the specified extension.
|
| void UnloadExtension(const std::string& extension_id,
|
| UnloadedExtensionInfo::Reason reason);
|
| @@ -343,13 +340,6 @@ class ExtensionService
|
| // extension.
|
| const SkBitmap& GetOmniboxPopupIcon(const std::string& extension_id);
|
|
|
| - // Clear all ExternalExtensionProviders.
|
| - void ClearProvidersForTesting();
|
| -
|
| - // Sets an ExternalExtensionProvider for the service to use during testing.
|
| - // Takes ownership of |test_provider|.
|
| - void AddProviderForTesting(ExternalExtensionProvider* test_provider);
|
| -
|
| // Called when the initial extensions load has completed.
|
| virtual void OnLoadedInstalledExtensions();
|
|
|
| @@ -359,12 +349,6 @@ class ExtensionService
|
| // Called by the backend when an extension has been installed.
|
| void OnExtensionInstalled(const Extension* extension);
|
|
|
| - // Called by the backend when an external extension is found.
|
| - void OnExternalExtensionFileFound(const std::string& id,
|
| - const std::string& version,
|
| - const FilePath& path,
|
| - Extension::Location location);
|
| -
|
| // Checks if the privileges requested by |extension| have increased, and if
|
| // so, disables the extension and prompts the user to approve the change.
|
| void DisableIfPrivilegeIncrease(const Extension* extension);
|
| @@ -426,6 +410,29 @@ class ExtensionService
|
| // view has been created.
|
| void DidCreateRenderViewForBackgroundPage(ExtensionHost* host);
|
|
|
| + // For the extension in |version_path| with |id|, check to see if it's an
|
| + // externally managed extension. If so, uninstall it.
|
| + void CheckExternalUninstall(const std::string& id);
|
| +
|
| + // Clear all ExternalExtensionProviders.
|
| + void ClearProvidersForTesting();
|
| +
|
| + // Adds an ExternalExtensionProviderInterface for the service to use during
|
| + // testing. Takes ownership of |test_provider|.
|
| + void AddProviderForTesting(ExternalExtensionProviderInterface* test_provider);
|
| +
|
| + // ExternalExtensionProvider::Visitor implementation.
|
| + virtual void OnExternalExtensionFileFound(const std::string& id,
|
| + const Version* version,
|
| + const FilePath& path,
|
| + Extension::Location location);
|
| +
|
| + virtual void OnExternalExtensionUpdateUrlFound(const std::string& id,
|
| + const GURL& update_url,
|
| + Extension::Location location);
|
| +
|
| + virtual void OnExternalProviderReady();
|
| +
|
| // NotificationObserver
|
| virtual void Observe(NotificationType type,
|
| const NotificationSource& source,
|
| @@ -601,6 +608,16 @@ class ExtensionService
|
| // Flag to make sure event routers are only initialized once.
|
| bool event_routers_initialized_;
|
|
|
| + // A collection of external extension providers. Each provider reads
|
| + // a source of external extension information. Examples include the
|
| + // windows registry and external_extensions.json.
|
| + ProviderCollection external_extension_providers_;
|
| +
|
| + // Set to true by OnExternalExtensionUpdateUrlFound() when an external
|
| + // extension URL is found. Used in CheckForExternalUpdates() to see
|
| + // if an update check is needed to install pending extensions.
|
| + bool external_extension_added_;
|
| +
|
| FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
|
| UpdatePendingExtensionAlreadyInstalled);
|
| FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
|
|
|