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

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

Issue 23064011: Consolidate scheme checks into an easy GURL method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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/browser/prerender/prerender_util.cc ('k') | chrome_frame/test/net/test_automation_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/manifest_url_handler.cc
diff --git a/chrome/common/extensions/manifest_url_handler.cc b/chrome/common/extensions/manifest_url_handler.cc
index 9605af470efb19220b67b42a9fbc666739b9d45f..31dc5194753c318fa8e07ca249b5c6ebd844f0c4 100644
--- a/chrome/common/extensions/manifest_url_handler.cc
+++ b/chrome/common/extensions/manifest_url_handler.cc
@@ -142,8 +142,7 @@ bool HomepageURLHandler::Parse(Extension* extension, string16* error) {
}
manifest_url->url_ = GURL(homepage_url_str);
if (!manifest_url->url_.is_valid() ||
- (!manifest_url->url_.SchemeIs("http") &&
- !manifest_url->url_.SchemeIs("https"))) {
+ !manifest_url->url_.SchemeIsHTTPOrHTTPS()) {
*error = ErrorUtils::FormatErrorMessageUTF16(
errors::kInvalidHomepageURL, homepage_url_str);
return false;
@@ -206,7 +205,7 @@ bool OptionsPageHandler::Parse(Extension* extension, string16* error) {
// hosted apps require an absolute URL.
GURL options_url(options_str);
if (!options_url.is_valid() ||
- !(options_url.SchemeIs("http") || options_url.SchemeIs("https"))) {
+ !options_url.SchemeIsHTTPOrHTTPS()) {
*error = ASCIIToUTF16(errors::kInvalidOptionsPageInHostedApp);
return false;
}
« no previous file with comments | « chrome/browser/prerender/prerender_util.cc ('k') | chrome_frame/test/net/test_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698