Index: chrome/common/extensions/csp_handler.cc |
diff --git a/chrome/common/extensions/csp_handler.cc b/chrome/common/extensions/csp_handler.cc |
index 8448854c3ac49ef588bd0ee2dff72ccf01489d6c..1ed5832a1577e10ab89239f00e2a54e612924c0d 100644 |
--- a/chrome/common/extensions/csp_handler.cc |
+++ b/chrome/common/extensions/csp_handler.cc |
@@ -68,9 +68,7 @@ CSPHandler::~CSPHandler() { |
} |
bool CSPHandler::Parse(Extension* extension, string16* error) { |
- const std::string& key = is_platform_app_ ? |
- keys::kPlatformAppContentSecurityPolicy : keys::kContentSecurityPolicy; |
- |
+ const std::string key = Keys()[0]; |
if (!extension->manifest()->HasPath(key)) { |
if (extension->manifest_version() >= 2) { |
// TODO(abarth): Should we continue to let extensions override the |
@@ -108,7 +106,7 @@ bool CSPHandler::Parse(Extension* extension, string16* error) { |
return true; |
} |
-bool CSPHandler::AlwaysParseForType(Manifest::Type type) { |
+bool CSPHandler::AlwaysParseForType(Manifest::Type type) const { |
if (is_platform_app_) |
return type == Manifest::TYPE_PLATFORM_APP; |
else |
@@ -116,4 +114,10 @@ bool CSPHandler::AlwaysParseForType(Manifest::Type type) { |
type == Manifest::TYPE_LEGACY_PACKAGED_APP; |
} |
+const std::vector<std::string> CSPHandler::Keys() const { |
+ const std::string& key = is_platform_app_ ? |
+ keys::kPlatformAppContentSecurityPolicy : keys::kContentSecurityPolicy; |
+ return SingleKey(key); |
+} |
+ |
} // namespace extensions |