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

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

Issue 9694038: OBSOLETE REVIEW. See http://codereview.chromium.org/10382149/ (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 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_;

Powered by Google App Engine
This is Rietveld 408576698