Index: chrome/common/extensions/extension.cc |
=================================================================== |
--- chrome/common/extensions/extension.cc (revision 80841) |
+++ chrome/common/extensions/extension.cc (working copy) |
@@ -1937,7 +1937,12 @@ |
// Only COMPONENT extensions can use private APIs. |
// TODO(asargent) - We want a more general purpose mechanism for this, |
// and better error messages. (http://crbug.com/54013) |
- if (!IsComponentOnlyPermission(permission_str)) { |
+ if (!IsComponentOnlyPermission(permission_str) |
+#ifndef NDEBUG |
+ && !CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kExposePrivateExtensionApi) |
+#endif |
+ ) { |
continue; |
} |
@@ -2534,7 +2539,12 @@ |
} |
bool Extension::CanExecuteScriptEverywhere() const { |
- if (location() == Extension::COMPONENT) |
+ if (location() == Extension::COMPONENT |
+#ifndef NDEBUG |
+ || CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kExposePrivateExtensionApi) |
+#endif |
+ ) |
return true; |
ScriptingWhitelist* whitelist = |