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

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

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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_validator.h ('k') | chrome/common/extensions/csp_validator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/csp_validator.cc
diff --git a/chrome/common/extensions/csp_validator.cc b/chrome/common/extensions/csp_validator.cc
index 3ce619290a51497d003b9537190705ab6d2aa339..814026ca4d79ff0cf101045b25e03d6a4bb028ca 100644
--- a/chrome/common/extensions/csp_validator.cc
+++ b/chrome/common/extensions/csp_validator.cc
@@ -35,7 +35,7 @@ struct DirectiveStatus {
bool is_secure;
};
-bool HasOnlySecureTokens(StringTokenizer& tokenizer, Extension::Type type) {
+bool HasOnlySecureTokens(StringTokenizer& tokenizer, Manifest::Type type) {
while (tokenizer.GetNext()) {
std::string source = tokenizer.token();
StringToLowerASCII(&source);
@@ -75,8 +75,8 @@ bool HasOnlySecureTokens(StringTokenizer& tokenizer, Extension::Type type) {
}
// crbug.com/146487
- if (type == Extension::TYPE_EXTENSION ||
- type == Extension::TYPE_LEGACY_PACKAGED_APP) {
+ if (type == Manifest::TYPE_EXTENSION ||
+ type == Manifest::TYPE_LEGACY_PACKAGED_APP) {
if (source == "'unsafe-eval'")
continue;
}
@@ -91,7 +91,7 @@ bool HasOnlySecureTokens(StringTokenizer& tokenizer, Extension::Type type) {
bool UpdateStatus(const std::string& directive_name,
StringTokenizer& tokenizer,
DirectiveStatus* status,
- Extension::Type type) {
+ Manifest::Type type) {
if (status->seen_in_policy)
return false;
if (directive_name != status->directive_name)
@@ -113,7 +113,7 @@ bool ContentSecurityPolicyIsLegal(const std::string& policy) {
}
bool ContentSecurityPolicyIsSecure(const std::string& policy,
- Extension::Type type) {
+ Manifest::Type type) {
// See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm.
std::vector<std::string> directives;
base::SplitString(policy, ';', &directives);
@@ -155,7 +155,7 @@ bool ContentSecurityPolicyIsSecure(const std::string& policy,
}
bool ContentSecurityPolicyIsSandboxed(
- const std::string& policy, Extension::Type type) {
+ const std::string& policy, Manifest::Type type) {
// See http://www.w3.org/TR/CSP/#parse-a-csp-policy for parsing algorithm.
std::vector<std::string> directives;
base::SplitString(policy, ';', &directives);
@@ -185,7 +185,7 @@ bool ContentSecurityPolicyIsSandboxed(
return false;
// Platform apps don't allow navigation.
- if (type == Extension::TYPE_PLATFORM_APP) {
+ if (type == Manifest::TYPE_PLATFORM_APP) {
if (token == kAllowTopNavigation)
return false;
}
« no previous file with comments | « chrome/common/extensions/csp_validator.h ('k') | chrome/common/extensions/csp_validator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698