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

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

Issue 23658056: content: Move kHttpScheme constant into content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/renderer/extensions/dispatcher.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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 (*text)[semicolon] = ':'; 412 (*text)[semicolon] = ':';
413 if (GetValidScheme(*text, &parts->scheme, &scheme)) 413 if (GetValidScheme(*text, &parts->scheme, &scheme))
414 found_scheme = true; 414 found_scheme = true;
415 else 415 else
416 (*text)[semicolon] = ';'; 416 (*text)[semicolon] = ';';
417 } 417 }
418 if (!found_scheme) { 418 if (!found_scheme) {
419 // Couldn't determine the scheme, so just pick one. 419 // Couldn't determine the scheme, so just pick one.
420 parts->scheme.reset(); 420 parts->scheme.reset();
421 scheme.assign(StartsWithASCII(*text, "ftp.", false) ? 421 scheme.assign(StartsWithASCII(*text, "ftp.", false) ?
422 chrome::kFtpScheme : chrome::kHttpScheme); 422 chrome::kFtpScheme : content::kHttpScheme);
423 } 423 }
424 } 424 }
425 425
426 // Proceed with about and chrome schemes, but not file or nonstandard schemes. 426 // Proceed with about and chrome schemes, but not file or nonstandard schemes.
427 if ((scheme != chrome::kAboutScheme) && (scheme != chrome::kChromeUIScheme) && 427 if ((scheme != chrome::kAboutScheme) && (scheme != chrome::kChromeUIScheme) &&
428 ((scheme == chrome::kFileScheme) || !url_util::IsStandard(scheme.c_str(), 428 ((scheme == chrome::kFileScheme) || !url_util::IsStandard(scheme.c_str(),
429 url_parse::Component(0, static_cast<int>(scheme.length()))))) 429 url_parse::Component(0, static_cast<int>(scheme.length())))))
430 return scheme; 430 return scheme;
431 431
432 if (scheme == chrome::kFileSystemScheme) { 432 if (scheme == chrome::kFileSystemScheme) {
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 636
637 if (part->is_valid()) { 637 if (part->is_valid()) {
638 // Offset the location of this component. 638 // Offset the location of this component.
639 part->begin += offset; 639 part->begin += offset;
640 640
641 // This part might not have existed in the original text. 641 // This part might not have existed in the original text.
642 if (part->begin < 0) 642 if (part->begin < 0)
643 part->reset(); 643 part->reset();
644 } 644 }
645 } 645 }
OLDNEW
« no previous file with comments | « chrome/common/content_settings_pattern.cc ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698