summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 18:50:12 +0000
committerbartfab@chromium.org <bartfab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-26 18:50:12 +0000
commit9bb69163f491cc1f1e3f412442a6ca0ad1a947fb (patch)
treedaf136a8e2ce3acc3d95d4c32462d3a88ff103b4 /extensions
parent5d55615db4d457399c2a3c3b06e913f422bc3bbe (diff)
downloadchromium_src-9bb69163f491cc1f1e3f412442a6ca0ad1a947fb.zip
chromium_src-9bb69163f491cc1f1e3f412442a6ca0ad1a947fb.tar.gz
chromium_src-9bb69163f491cc1f1e3f412442a6ca0ad1a947fb.tar.bz2
Add EXTERNAL_POLICY to list of possible extension locations
This CL adds a new extension location, EXTERNAL_POLICY. This will be used for CRX files that are force-installed through policy but instead of being downloaded and installed directly, are cached on disk first. BUG=287802 TEST=Manual Review URL: https://codereview.chromium.org/24365004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@225526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/manifest.cc6
-rw-r--r--extensions/common/manifest.h10
2 files changed, 15 insertions, 1 deletions
diff --git a/extensions/common/manifest.cc b/extensions/common/manifest.cc
index 85b5d98..4decdd3 100644
--- a/extensions/common/manifest.cc
+++ b/extensions/common/manifest.cc
@@ -34,11 +34,15 @@ int GetLocationRank(Manifest::Location location) {
switch (location) {
// Component extensions can not be overriden by any other type.
case Manifest::COMPONENT:
- rank = 7;
+ rank = 8;
break;
// Policy controlled extensions may not be overridden by any type
// that is not part of chrome.
+ case Manifest::EXTERNAL_POLICY:
+ rank = 7;
+ break;
+
case Manifest::EXTERNAL_POLICY_DOWNLOAD:
rank = 6;
break;
diff --git a/extensions/common/manifest.h b/extensions/common/manifest.h
index c4ceb387..4bf92ec 100644
--- a/extensions/common/manifest.h
+++ b/extensions/common/manifest.h
@@ -40,6 +40,9 @@ class Manifest {
EXTERNAL_POLICY_DOWNLOAD, // A crx file from an external directory (via
// admin policies), installed from an update URL.
COMMAND_LINE, // --load-extension.
+ EXTERNAL_POLICY, // A crx file from an external directory (via admin
+ // policies), cached locally and installed from the
+ // cache.
NUM_LOCATIONS
};
@@ -69,6 +72,7 @@ class Manifest {
return location == EXTERNAL_PREF ||
location == EXTERNAL_REGISTRY ||
location == EXTERNAL_PREF_DOWNLOAD ||
+ location == EXTERNAL_POLICY ||
location == EXTERNAL_POLICY_DOWNLOAD;
}
@@ -84,6 +88,12 @@ class Manifest {
IsExternalLocation(location);
}
+ // Whether the |location| is a source of extensions force-installed through
+ // policy.
+ static inline bool IsPolicyLocation(Location location) {
+ return location == EXTERNAL_POLICY || location == EXTERNAL_POLICY_DOWNLOAD;
+ }
+
// Unpacked extensions start off with file access since they are a developer
// feature.
static inline bool ShouldAlwaysAllowFileAccess(Location location) {