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

Side by Side Diff: chrome/browser/extensions/standard_management_policy_provider.cc

Issue 666223005: Don't block shared_module extensions by the policy blacklist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed FilePath Created 6 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/standard_management_policy_provider.h" 5 #include "chrome/browser/extensions/standard_management_policy_provider.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 #endif 69 #endif
70 } 70 }
71 71
72 bool StandardManagementPolicyProvider::UserMayLoad( 72 bool StandardManagementPolicyProvider::UserMayLoad(
73 const Extension* extension, 73 const Extension* extension,
74 base::string16* error) const { 74 base::string16* error) const {
75 // Component extensions are always allowed. 75 // Component extensions are always allowed.
76 if (Manifest::IsComponentLocation(extension->location())) 76 if (Manifest::IsComponentLocation(extension->location()))
77 return true; 77 return true;
78 78
79 // Shared modules are always allowed too: they only contain resources that
80 // are used by other extensions. The extension that depends on the shared
81 // module may be filtered by policy.
82 if (extension->is_shared_module())
83 return true;
84
79 ExtensionManagement::InstallationMode installation_mode = 85 ExtensionManagement::InstallationMode installation_mode =
80 settings_->GetInstallationMode(extension->id()); 86 settings_->GetInstallationMode(extension->id());
81 87
82 // Force-installed extensions cannot be overwritten manually. 88 // Force-installed extensions cannot be overwritten manually.
83 if (!Manifest::IsPolicyLocation(extension->location()) && 89 if (!Manifest::IsPolicyLocation(extension->location()) &&
84 installation_mode == ExtensionManagement::INSTALLATION_FORCED) { 90 installation_mode == ExtensionManagement::INSTALLATION_FORCED) {
85 return ReturnLoadError(extension, error); 91 return ReturnLoadError(extension, error);
86 } 92 }
87 93
88 // Check whether the extension type is allowed. 94 // Check whether the extension type is allowed.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 *error = l10n_util::GetStringFUTF16( 152 *error = l10n_util::GetStringFUTF16(
147 IDS_EXTENSION_CANT_UNINSTALL_POLICY_REQUIRED, 153 IDS_EXTENSION_CANT_UNINSTALL_POLICY_REQUIRED,
148 base::UTF8ToUTF16(extension->name())); 154 base::UTF8ToUTF16(extension->name()));
149 } 155 }
150 return true; 156 return true;
151 } 157 }
152 return false; 158 return false;
153 } 159 }
154 160
155 } // namespace extensions 161 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/crx_installer.cc ('k') | chrome/browser/policy/policy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698