| Index: chrome/browser/extensions/extension_service.h
|
| ===================================================================
|
| --- chrome/browser/extensions/extension_service.h (revision 136836)
|
| +++ chrome/browser/extensions/extension_service.h (working copy)
|
| @@ -20,12 +20,14 @@
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| #include "base/property_bag.h"
|
| +#include "base/string16.h"
|
| #include "base/time.h"
|
| #include "base/tuple.h"
|
| #include "chrome/browser/extensions/app_shortcut_manager.h"
|
| #include "chrome/browser/extensions/app_sync_bundle.h"
|
| #include "chrome/browser/extensions/apps_promo.h"
|
| #include "chrome/browser/extensions/extension_icon_manager.h"
|
| +#include "chrome/browser/extensions/extension_management_policy.h"
|
| #include "chrome/browser/extensions/extension_menu_manager.h"
|
| #include "chrome/browser/extensions/extension_prefs.h"
|
| #include "chrome/browser/extensions/extension_process_manager.h"
|
| @@ -97,6 +99,7 @@
|
| virtual const ExtensionSet* extensions() const = 0;
|
| virtual const ExtensionSet* disabled_extensions() const = 0;
|
| virtual PendingExtensionManager* pending_extension_manager() = 0;
|
| + virtual ExtensionManagementPolicy* extension_management_policy() = 0;
|
|
|
| // Install an update. Return true if the install can be started.
|
| // Set out_crx_installer to the installer if one was started.
|
| @@ -138,6 +141,7 @@
|
| // Manages installed and running Chromium extensions.
|
| class ExtensionService
|
| : public ExtensionServiceInterface,
|
| + public ExtensionManagementPolicy::Delegate,
|
| public ExternalExtensionProviderInterface::VisitorInterface,
|
| public base::SupportsWeakPtr<ExtensionService>,
|
| public content::NotificationObserver {
|
| @@ -214,6 +218,8 @@
|
| // Gets the object managing the set of pending extensions.
|
| virtual PendingExtensionManager* pending_extension_manager() OVERRIDE;
|
|
|
| + virtual ExtensionManagementPolicy* extension_management_policy() OVERRIDE;
|
| +
|
| const FilePath& install_directory() const { return install_directory_; }
|
|
|
| AppsPromo* apps_promo() { return &apps_promo_; }
|
| @@ -333,13 +339,25 @@
|
| // to ExtensionPrefs some other way.
|
| virtual bool UninstallExtension(std::string extension_id,
|
| bool external_uninstall,
|
| - std::string* error);
|
| + string16* error);
|
|
|
| virtual bool IsExtensionEnabled(
|
| const std::string& extension_id) const OVERRIDE;
|
| virtual bool IsExternalExtensionUninstalled(
|
| const std::string& extension_id) const OVERRIDE;
|
|
|
| + // ExtensionManagementPolicy::Delegate implementation.
|
| + // The ExtensionService is the keeper of the ExtensionManagementPolicy so
|
| + // other callers can query it. It's also an ExtensionManagementPolicy
|
| + // delegate itself, exposing any restrictions imposed by an individual
|
| + // extension.
|
| + virtual bool UserMayModifyStatus(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| + virtual bool UserMayModifyUsage(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| + virtual bool MustRemainEnabled(const Extension* extension,
|
| + string16* error) const OVERRIDE;
|
| +
|
| // Enables the extension. If the extension is already enabled, does
|
| // nothing.
|
| virtual void EnableExtension(const std::string& extension_id);
|
| @@ -415,7 +433,7 @@
|
| const std::vector<std::string>& blacklist) OVERRIDE;
|
|
|
| // Go through each extension and unload those that the network admin has
|
| - // put on the blacklist (not to be confused with the Google managed blacklist
|
| + // put on the blacklist (not to be confused with the Google-managed blacklist)
|
| // set of extensions.
|
| virtual void CheckAdminBlacklist() OVERRIDE;
|
|
|
| @@ -666,6 +684,12 @@
|
| bool include_disabled,
|
| bool include_terminated) const;
|
|
|
| + // Internal implementation for ExtensionManagementPolicy::Delegate methods.
|
| + // Returns |modifiable_value| if the extension can be modified.
|
| + bool ExtensionManagementPolicyImpl(const Extension* extension,
|
| + string16* error,
|
| + bool modifiable_value) const;
|
| +
|
| // Adds the given extension to the list of terminated extensions if
|
| // it is not already there and unloads it.
|
| void TrackTerminatedExtension(const Extension* extension);
|
| @@ -723,6 +747,9 @@
|
| // Hold the set of pending extensions.
|
| PendingExtensionManager pending_extension_manager_;
|
|
|
| + // ***
|
| + ExtensionManagementPolicy extension_management_policy_;
|
| +
|
| // The map of extension IDs to their runtime data.
|
| ExtensionRuntimeDataMap extension_runtime_data_;
|
|
|
|
|