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

Unified Diff: chrome/browser/extensions/extension_management_policy.cc

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_management_policy.cc
===================================================================
--- chrome/browser/extensions/extension_management_policy.cc (revision 0)
+++ chrome/browser/extensions/extension_management_policy.cc (revision 0)
@@ -0,0 +1,93 @@
+// Copyright (c) 2012 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.
+
+#include "chrome/browser/extensions/extension_management_policy.h"
+
+ExtensionManagementPolicy::ExtensionManagementPolicy() {
+}
+
+ExtensionManagementPolicy::~ExtensionManagementPolicy() {
+}
+
+bool ExtensionManagementPolicy::Delegate::UserMayInstall(
+ const std::string& extension_id,
+ Extension::Location location,
+ const std::string& extension_name,
+ string16* error) const {
+ return true;
+}
+
+// Enable, disable, remove
+bool ExtensionManagementPolicy::Delegate::UserMayModifyStatus(
+ const Extension* extension, string16* error) const {
+ return true;
+}
+// Incognito, file access, etc.
+bool ExtensionManagementPolicy::Delegate::UserMayModifyUsage(
+ const Extension* extension, string16* error) const {
+ return true;
+}
+
+// Forced on
+bool ExtensionManagementPolicy::Delegate::MustRemainEnabled(
+ const Extension* extension, string16* error) const {
+ return false;
+}
+
+void ExtensionManagementPolicy::RegisterDelegate(Delegate* delegate) {
+ delegates_.insert(delegate);
+}
+
+void ExtensionManagementPolicy::UnregisterDelegate(Delegate* delegate) {
+ delegates_.erase(delegate);
+}
+
+bool ExtensionManagementPolicy::UserMayInstall(const std::string& extension_id,
+ Extension::Location location, const std::string& extension_name,
+ string16* error) const {
+ for (DelegateList::const_iterator it = delegates_.begin();
+ it != delegates_.end(); ++it) {
+ if (!(*it)->UserMayInstall(extension_id, location, extension_name, error))
Aaron Boodman 2012/05/17 22:41:06 For debugging purposes, I suggest giving each poli
Aaron Boodman 2012/05/17 22:41:06 It seems like the providers will also be intereste
Pam (message me for reviews) 2012/05/18 20:15:15 Sure. To avoid spam, since these get called to che
Pam (message me for reviews) 2012/05/18 20:15:15 Yes, as long as we also pass the location, since C
+ return false;
+ }
+ return true;
+}
+
+bool ExtensionManagementPolicy::UserMayModifyStatus(
+ const Extension* extension, string16* error) const {
+ for (DelegateList::const_iterator it = delegates_.begin();
+ it != delegates_.end(); ++it) {
+ if (!(*it)->UserMayModifyStatus(extension, error))
+ return false;
+ }
+ return true;
+}
+
+bool ExtensionManagementPolicy::UserMayModifyUsage(
+ const Extension* extension, string16* error) const {
+ for (DelegateList::const_iterator it = delegates_.begin();
+ it != delegates_.end(); ++it) {
+ if (!(*it)->UserMayModifyUsage(extension, error))
+ return false;
+ }
+ return true;
+}
+
+bool ExtensionManagementPolicy::MustRemainEnabled(
+ const Extension* extension, string16* error) const {
+ for (DelegateList::const_iterator it = delegates_.begin();
+ it != delegates_.end(); ++it) {
+ if ((*it)->MustRemainEnabled(extension, error))
+ return true;
+ }
+ return false;
+}
+
+void ExtensionManagementPolicy::UnregisterAllDelegates() {
+ delegates_.clear();
+}
+
+size_t ExtensionManagementPolicy::CountDelegates() {
+ return delegates_.size();
+}
Property changes on: chrome\browser\extensions\extension_management_policy.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698