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

Unified Diff: chrome/browser/net/url_fixer_upper.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/importer/ie_importer.cc ('k') | chrome/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/url_fixer_upper.cc
===================================================================
--- chrome/browser/net/url_fixer_upper.cc (revision 10345)
+++ chrome/browser/net/url_fixer_upper.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/string_util.h"
#include "chrome/common/gfx/text_elider.h"
+#include "chrome/common/url_constants.h"
#include "googleurl/src/gurl.h"
#include "googleurl/src/url_canon.h"
#include "googleurl/src/url_file.h"
@@ -303,14 +304,16 @@
// When we couldn't find a scheme in the input, we need to pick one. Normally
// we choose http, but if the URL starts with "ftp.", we match other browsers
// and choose ftp.
- if (!parts->scheme.is_valid())
- scheme.assign(StartsWithASCII(text, "ftp.", false) ? "ftp" : "http");
+ if (!parts->scheme.is_valid()) {
+ scheme.assign(StartsWithASCII(text, "ftp.", false) ?
+ chrome::kFtpScheme : chrome::kHttpScheme);
+ }
// Cannonicalize the scheme.
StringToLowerASCII(&scheme);
// Not segmenting file schemes or nonstandard schemes.
- if ((scheme == "file") ||
+ if ((scheme == chrome::kFileScheme) ||
!url_util::IsStandard(scheme.c_str(), static_cast<int>(scheme.length()),
url_parse::Component(0, static_cast<int>(scheme.length()))))
return scheme;
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698