Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3252)

Unified Diff: chrome/browser/extensions/extension_service.h

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698