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

Unified Diff: chrome/browser/url_fixer_upper.cc

Issue 16511: If the URL text has no scheme, and starts with ftp., then ... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | chrome/browser/url_fixer_upper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/url_fixer_upper.cc
===================================================================
--- chrome/browser/url_fixer_upper.cc (revision 7653)
+++ chrome/browser/url_fixer_upper.cc (working copy)
@@ -287,16 +287,11 @@
parts->scheme.reset();
}
- // Check to see if we've found a scheme we liked.
- int scheme_end;
- if (parts->scheme.is_valid()) {
- // Remember the end of the scheme.
- scheme_end = parts->scheme.end();
- } else {
- // Having been unable to extract a scheme, we default to HTTP.
- scheme.assign(L"http");
- scheme_end = 0;
- }
+ // 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(StartsWith(text, L"ftp.", false) ? L"ftp" : L"http");
// Cannonicalize the scheme.
StringToLowerASCII(&scheme);
« no previous file with comments | « no previous file | chrome/browser/url_fixer_upper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698