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

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

Issue 12253022: Manifest handler for all keys background-related. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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/extensions/csp_handler.h ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/common/extensions/csp_handler.h ('k') | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698