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

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

Issue 8380006: Exempt component and policy-installed extensions from policy blacklist check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, add comment regarding policy check on startup. Created 9 years, 2 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.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index e3faf90b4fe95a5dcdee50b0aa49fa2e7a5f9ebc..d38a0c6e554805915075885c5d995aa3c1ebed25 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -7,8 +7,8 @@
#include <algorithm>
#include <set>
-#include "base/bind.h"
#include "base/basictypes.h"
+#include "base/bind.h"
#include "base/callback.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -92,8 +92,8 @@
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/user_metrics.h"
-#include "content/public/browser/notification_service.h"
#include "content/common/pepper_plugin_registry.h"
+#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "googleurl/src/gurl.h"
#include "net/base/registry_controlled_domain.h"
@@ -1397,7 +1397,12 @@ void ExtensionService::LoadInstalledExtension(const ExtensionInfo& info,
bool write_to_prefs) {
std::string error;
scoped_refptr<const Extension> extension(NULL);
- if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id)) {
+
+ // An explicit check against policy is required to behave correctly during
+ // startup. This is because extensions that were previously OK might have
+ // been blacklisted in policy while Chrome was not running.
+ if (!extension_prefs_->IsExtensionAllowedByPolicy(info.extension_id,
+ info.extension_location)) {
error = errors::kDisabledByPolicy;
} else if (info.extension_manifest.get()) {
extension = Extension::Create(
@@ -1691,8 +1696,10 @@ void ExtensionService::CheckAdminBlacklist() {
for (ExtensionList::const_iterator iter = extensions_.begin();
iter != extensions_.end(); ++iter) {
const Extension* extension = (*iter);
- if (!extension_prefs_->IsExtensionAllowedByPolicy(extension->id()))
+ if (!extension_prefs_->IsExtensionAllowedByPolicy(extension->id(),
+ extension->location())) {
to_be_removed.push_back(extension->id());
+ }
}
// UnloadExtension will change the extensions_ list. So, we should
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698