Chromium Code Reviews| Index: chrome/browser/extensions/extension_service.h |
| =================================================================== |
| --- chrome/browser/extensions/extension_service.h (revision 138227) |
| +++ chrome/browser/extensions/extension_service.h (working copy) |
| @@ -20,6 +20,7 @@ |
| #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" |
| @@ -34,6 +35,7 @@ |
| #include "chrome/browser/extensions/extension_warning_set.h" |
| #include "chrome/browser/extensions/extensions_quota_service.h" |
| #include "chrome/browser/extensions/external_extension_provider_interface.h" |
| +#include "chrome/browser/extensions/management_policy.h" |
| #include "chrome/browser/extensions/pending_extension_manager.h" |
| #include "chrome/browser/extensions/process_map.h" |
| #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
| @@ -141,6 +143,7 @@ |
| // Manages installed and running Chromium extensions. |
| class ExtensionService |
| : public ExtensionServiceInterface, |
| + public extensions::ManagementPolicy::Provider, |
| public ExternalExtensionProviderInterface::VisitorInterface, |
| public base::SupportsWeakPtr<ExtensionService>, |
| public content::NotificationObserver { |
| @@ -329,13 +332,22 @@ |
| // 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; |
| + // ManagementPolicy::Provider |
| + // The ExtensionService exposes any restrictions imposed by an individual |
|
Aaron Boodman
2012/05/22 15:56:11
This comment doesn't seem correct compared to the
|
| + // extension. |
| + virtual std::string PolicyProviderName() const OVERRIDE; |
| + virtual bool UserMayModifyStatus(const extensions::Extension* extension, |
| + string16* error) const OVERRIDE; |
| + virtual bool MustRemainEnabled(const extensions::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); |
| @@ -410,7 +422,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; |
| @@ -664,6 +676,12 @@ |
| bool include_disabled, |
| bool include_terminated) const; |
| + // Internal implementation for ManagementPolicy::Delegate methods. |
| + // Returns |modifiable_value| if the extension can be modified. |
| + bool ManagementPolicyImpl(const extensions::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 extensions::Extension* extension); |