Index: extensions/common/manifest_handlers/content_capabilities_handler.cc |
diff --git a/extensions/common/manifest_handlers/content_capabilities_handler.cc b/extensions/common/manifest_handlers/content_capabilities_handler.cc |
index a55bb8273d215eded92b4bffffff6acee66f79fb..b9b0f7433cd50638e2156bb7c11b6fe97c3aa229 100644 |
--- a/extensions/common/manifest_handlers/content_capabilities_handler.cc |
+++ b/extensions/common/manifest_handlers/content_capabilities_handler.cc |
@@ -4,11 +4,13 @@ |
#include "extensions/common/manifest_handlers/content_capabilities_handler.h" |
+#include "base/command_line.h" |
#include "base/lazy_instance.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/values.h" |
+#include "content/public/common/content_switches.h" |
#include "extensions/common/api/extensions_manifest_types.h" |
#include "extensions/common/error_utils.h" |
#include "extensions/common/install_warning.h" |
@@ -61,10 +63,16 @@ bool ContentCapabilitiesHandler::Parse(Extension* extension, |
if (!capabilities) |
return false; |
+ int supported_schemes = URLPattern::SCHEME_HTTPS; |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kTestType)) { |
+ supported_schemes |= URLPattern::SCHEME_HTTP; |
not at google - send to devlin
2014/12/10 17:33:54
Mention why (... and shame there is no https mode
Ken Rockot(use gerrit already)
2014/12/10 18:31:41
Heh. Done.
|
+ } |
+ |
std::string url_error; |
URLPatternSet potential_url_patterns; |
if (!potential_url_patterns.Populate(capabilities->matches, |
- URLPattern::SCHEME_HTTPS, false /* allow_file_access */, |
+ supported_schemes, false /* allow_file_access */, |
&url_error)) { |
*error = ErrorUtils::FormatErrorMessageUTF16( |
errors::kInvalidContentCapabilitiesMatch, url_error); |