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

Side by Side Diff: chrome/common/net/url_fixer_upper.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/search_urls.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/net/url_fixer_upper.h" 5 #include "chrome/common/net/url_fixer_upper.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #if defined(OS_POSIX) 9 #if defined(OS_POSIX)
10 #include "base/environment.h" 10 #include "base/environment.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 (*text)[semicolon] = ':'; 417 (*text)[semicolon] = ':';
418 if (GetValidScheme(*text, &parts->scheme, &scheme)) 418 if (GetValidScheme(*text, &parts->scheme, &scheme))
419 found_scheme = true; 419 found_scheme = true;
420 else 420 else
421 (*text)[semicolon] = ';'; 421 (*text)[semicolon] = ';';
422 } 422 }
423 if (!found_scheme) { 423 if (!found_scheme) {
424 // Couldn't determine the scheme, so just pick one. 424 // Couldn't determine the scheme, so just pick one.
425 parts->scheme.reset(); 425 parts->scheme.reset();
426 scheme = StartsWithASCII(*text, "ftp.", false) ? 426 scheme = StartsWithASCII(*text, "ftp.", false) ?
427 content::kFtpScheme : content::kHttpScheme; 427 content::kFtpScheme : url::kHttpScheme;
428 } 428 }
429 } 429 }
430 430
431 // Proceed with about and chrome schemes, but not file or nonstandard schemes. 431 // Proceed with about and chrome schemes, but not file or nonstandard schemes.
432 if ((scheme != content::kAboutScheme) && 432 if ((scheme != content::kAboutScheme) &&
433 (scheme != content::kChromeUIScheme) && 433 (scheme != content::kChromeUIScheme) &&
434 ((scheme == content::kFileScheme) || 434 ((scheme == content::kFileScheme) ||
435 !url::IsStandard(scheme.c_str(), 435 !url::IsStandard(scheme.c_str(),
436 url::Component(0, 436 url::Component(0,
437 static_cast<int>(scheme.length()))))) { 437 static_cast<int>(scheme.length()))))) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 646
647 if (part->is_valid()) { 647 if (part->is_valid()) {
648 // Offset the location of this component. 648 // Offset the location of this component.
649 part->begin += offset; 649 part->begin += offset;
650 650
651 // This part might not have existed in the original text. 651 // This part might not have existed in the original text.
652 if (part->begin < 0) 652 if (part->begin < 0)
653 part->reset(); 653 part->reset();
654 } 654 }
655 } 655 }
OLDNEW
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/common/search_urls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698