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

Unified Diff: chrome/common/extensions/extension.cc

Issue 8659002: Adding the --load-component-extension flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 1ea3041df5e8058805c7fa94ca67b851288751d1..761b386ada5d48d81e7b5911ed6c50c061fc918e 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -2058,7 +2058,7 @@ bool Extension::InitFromValue(const DictionaryValue& source, int flags,
page != chrome::kChromeUIHistoryHost
#if defined(FILE_MANAGER_EXTENSION)
&&
- !(location() == COMPONENT &&
+ !(CanSpecifyComponentOnlyPermission() &&
page == chrome::kChromeUIFileManagerHost)
#endif
) ||
@@ -2873,12 +2873,11 @@ bool Extension::CanSpecifyComponentOnlyPermission() const {
if (location_ == Extension::COMPONENT)
return true;
-#ifndef NDEBUG
- if (CommandLine::ForCurrentProcess()->HasSwitch(
+ if (location_ == Extension::LOAD &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
switches::kExposePrivateExtensionApi)) {
return true;
}
-#endif
return false;
}
@@ -2913,12 +2912,12 @@ bool Extension::CanSpecifyPermissionForHostedApp(
}
bool Extension::CanExecuteScriptEverywhere() const {
- if (location() == Extension::COMPONENT
-#ifndef NDEBUG
- || CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kExposePrivateExtensionApi)
-#endif
+ if (location() == Extension::COMPONENT ||
+ (location() == Extension::LOAD &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kExposePrivateExtensionApi)
)
Aaron Boodman 2011/11/28 18:29:59 Nit: these parens should be up on line 2918.
SeRya 2011/11/28 23:49:53 Done.
+ )
return true;
ScriptingWhitelist* whitelist =
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698