Chromium Code Reviews| 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 = |