diff options
author | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 02:21:36 +0000 |
---|---|---|
committer | rlp@chromium.org <rlp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-12 02:21:36 +0000 |
commit | 4eef435499db92d0fce1f42648be6d794caef0c1 (patch) | |
tree | 629164b3369a6458a43cc8d9c0d339d7606b0067 /extensions | |
parent | f743a435200651dc51b5137ed74857e8e3fcea72 (diff) | |
download | chromium_src-4eef435499db92d0fce1f42648be6d794caef0c1.zip chromium_src-4eef435499db92d0fce1f42648be6d794caef0c1.tar.gz chromium_src-4eef435499db92d0fce1f42648be6d794caef0c1.tar.bz2 |
[Hotword, Extensions] Removing EXTERNAL_COMPONENT from IsPolicyLocation, adding a function to check if an extension is a component extension, and updating places IsPolicyLocation was used.
This is necessary for the correct look for hotwording.
BUG=341611, 325439, 289023
Review URL: https://codereview.chromium.org/156153005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@250614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/browser/admin_policy.cc | 2 | ||||
-rw-r--r-- | extensions/common/extension.cc | 3 | ||||
-rw-r--r-- | extensions/common/manifest.h | 9 |
3 files changed, 9 insertions, 5 deletions
diff --git a/extensions/browser/admin_policy.cc b/extensions/browser/admin_policy.cc index d961da1..cb94887 100644 --- a/extensions/browser/admin_policy.cc +++ b/extensions/browser/admin_policy.cc @@ -16,7 +16,7 @@ bool ManagementPolicyImpl(const extensions::Extension* extension, base::string16* error, bool modifiable_value) { bool modifiable = - extension->location() != extensions::Manifest::COMPONENT && + !extensions::Manifest::IsComponentLocation(extension->location()) && !extensions::Manifest::IsPolicyLocation(extension->location()); // Some callers equate "no restriction" to true, others to false. if (modifiable) diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc index 813fa66..df6ea04 100644 --- a/extensions/common/extension.cc +++ b/extensions/common/extension.cc @@ -371,8 +371,7 @@ bool Extension::ShouldDisplayInExtensionSettings() const { bool Extension::ShouldNotBeVisible() const { // Don't show component extensions because they are only extensions as an // implementation detail of Chrome. - if ((location() == Manifest::COMPONENT || - location() == Manifest::EXTERNAL_COMPONENT) && + if (extensions::Manifest::IsComponentLocation(location()) && !CommandLine::ForCurrentProcess()->HasSwitch( switches::kShowComponentExtensionOptions)) { return true; diff --git a/extensions/common/manifest.h b/extensions/common/manifest.h index 8f4c3c7..a50e724 100644 --- a/extensions/common/manifest.h +++ b/extensions/common/manifest.h @@ -96,8 +96,13 @@ class Manifest { // policy. static inline bool IsPolicyLocation(Location location) { return location == EXTERNAL_POLICY || - location == EXTERNAL_POLICY_DOWNLOAD || - location == EXTERNAL_COMPONENT; + location == EXTERNAL_POLICY_DOWNLOAD; + } + + // Whether the |location| is an extension intended to be an internal part of + // Chrome. + static inline bool IsComponentLocation(Location location) { + return location == COMPONENT || location == EXTERNAL_COMPONENT; } // Unpacked extensions start off with file access since they are a developer |