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

Side by Side Diff: components/url_formatter/url_fixer.cc

Issue 1765993002: Remove UnescapeRule::URL_SPECIAL_CHARS from components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to comments Created 4 years, 9 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 | « components/signin/core/browser/signin_header_helper.cc ('k') | no next file » | 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 "components/url_formatter/url_fixer.h" 5 #include "components/url_formatter/url_fixer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 if (gurl.is_valid() && gurl.IsStandard()) 613 if (gurl.is_valid() && gurl.IsStandard())
614 is_file = false; 614 is_file = false;
615 base::FilePath full_path; 615 base::FilePath full_path;
616 if (is_file && !ValidPathForFile(trimmed, &full_path)) { 616 if (is_file && !ValidPathForFile(trimmed, &full_path)) {
617 // Not a path as entered, try unescaping it in case the user has 617 // Not a path as entered, try unescaping it in case the user has
618 // escaped things. We need to go through 8-bit since the escaped values 618 // escaped things. We need to go through 8-bit since the escaped values
619 // only represent 8-bit values. 619 // only represent 8-bit values.
620 #if defined(OS_WIN) 620 #if defined(OS_WIN)
621 std::wstring unescaped = base::UTF8ToWide(net::UnescapeURLComponent( 621 std::wstring unescaped = base::UTF8ToWide(net::UnescapeURLComponent(
622 base::WideToUTF8(trimmed), 622 base::WideToUTF8(trimmed),
623 net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS)); 623 net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
624 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS));
624 #elif defined(OS_POSIX) 625 #elif defined(OS_POSIX)
625 std::string unescaped = net::UnescapeURLComponent( 626 std::string unescaped = net::UnescapeURLComponent(
626 trimmed, 627 trimmed,
627 net::UnescapeRule::SPACES | net::UnescapeRule::URL_SPECIAL_CHARS); 628 net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
629 net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
628 #endif 630 #endif
629 631
630 if (!ValidPathForFile(unescaped, &full_path)) 632 if (!ValidPathForFile(unescaped, &full_path))
631 is_file = false; 633 is_file = false;
632 } 634 }
633 635
634 // Put back the current directory if we saved it. 636 // Put back the current directory if we saved it.
635 if (!base_dir.empty()) 637 if (!base_dir.empty())
636 base::SetCurrentDirectory(old_cur_directory); 638 base::SetCurrentDirectory(old_cur_directory);
637 639
(...skipping 30 matching lines...) Expand all
668 } 670 }
669 671
670 bool IsEquivalentScheme(const std::string& scheme1, 672 bool IsEquivalentScheme(const std::string& scheme1,
671 const std::string& scheme2) { 673 const std::string& scheme2) {
672 return scheme1 == scheme2 || 674 return scheme1 == scheme2 ||
673 (scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) || 675 (scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) ||
674 (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme); 676 (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme);
675 } 677 }
676 678
677 } // namespace url_formatter 679 } // namespace url_formatter
OLDNEW
« no previous file with comments | « components/signin/core/browser/signin_header_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698