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

Unified Diff: chrome/browser/search_engines/template_url_parser.cc

Issue 31008: Coalesce more hardcoded schemes to using predefined constants. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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/browser/search_engines/template_url_model.cc ('k') | chrome/browser/ssl/ssl_policy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search_engines/template_url_parser.cc
===================================================================
--- chrome/browser/search_engines/template_url_parser.cc (revision 10345)
+++ chrome/browser/search_engines/template_url_parser.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/scoped_ptr.h"
#include "base/string_util.h"
#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
#include "libxml/parser.h"
#include "libxml/xmlwriter.h"
@@ -482,7 +483,7 @@
break;
case ParsingContext::IMAGE: {
GURL image_url(WideToUTF8(context->GetString()));
- if (image_url.SchemeIs("data")) {
+ if (image_url.SchemeIs(chrome::kDataScheme)) {
// TODO (jcampan): bug 1169256: when dealing with data URL, we need to
// decode the data URL in the renderer. For now, we'll just point to the
// fav icon from the URL.
@@ -523,7 +524,8 @@
if (ref == NULL)
return true;
GURL url(WideToUTF8(ref->url()));
- return (url.is_valid() && (url.SchemeIs("http") || url.SchemeIs("https")));
+ return (url.is_valid() && (url.SchemeIs(chrome::kHttpScheme) ||
+ url.SchemeIs(chrome::kHttpsScheme)));
}
// Returns true if the TemplateURL is legal. A legal TemplateURL is one
@@ -536,7 +538,8 @@
for (size_t i = 0; i < image_refs.size(); i++) {
GURL image_url(image_refs[i].url);
if (!image_url.is_valid() ||
- !(image_url.SchemeIs("http") || image_url.SchemeIs("https"))) {
+ !(image_url.SchemeIs(chrome::kHttpScheme) ||
+ image_url.SchemeIs(chrome::kHttpsScheme))) {
return false;
}
}
« no previous file with comments | « chrome/browser/search_engines/template_url_model.cc ('k') | chrome/browser/ssl/ssl_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698