OLD | NEW |
---|---|
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_fixer/url_fixer.h" | 5 #include "components/url_fixer/url_fixer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 if (filename.length() > 1 && filename[1] == '|') | 171 if (filename.length() > 1 && filename[1] == '|') |
172 filename[1] = ':'; | 172 filename[1] = ':'; |
173 #elif defined(OS_POSIX) | 173 #elif defined(OS_POSIX) |
174 base::FilePath input_path(text); | 174 base::FilePath input_path(text); |
175 PrepareStringForFileOps(input_path, &filename); | 175 PrepareStringForFileOps(input_path, &filename); |
176 if (filename.length() > 0 && filename[0] == '~') | 176 if (filename.length() > 0 && filename[0] == '~') |
177 filename = FixupHomedir(filename); | 177 filename = FixupHomedir(filename); |
178 #endif | 178 #endif |
179 | 179 |
180 // Here, we know the input looks like a file. | 180 // Here, we know the input looks like a file. |
181 GURL file_url = net::FilePathToFileURL(base::FilePath(filename)); | 181 GURL file_url = net::FilePathToFileURLNoCWD(base::FilePath(filename)); |
davidben
2015/04/14 16:26:22
This is a loss of functionality for this function.
| |
182 if (file_url.is_valid()) { | 182 if (file_url.is_valid()) { |
183 return base::UTF16ToUTF8(net::FormatUrl(file_url, | 183 return base::UTF16ToUTF8(net::FormatUrl(file_url, |
184 std::string(), | 184 std::string(), |
185 net::kFormatUrlOmitUsernamePassword, | 185 net::kFormatUrlOmitUsernamePassword, |
186 net::UnescapeRule::NORMAL, | 186 net::UnescapeRule::NORMAL, |
187 NULL, | 187 NULL, |
188 NULL, | 188 NULL, |
189 NULL)); | 189 NULL)); |
190 } | 190 } |
191 | 191 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 part->reset(); | 669 part->reset(); |
670 } | 670 } |
671 } | 671 } |
672 | 672 |
673 bool url_fixer::IsEquivalentScheme(const std::string& scheme1, | 673 bool url_fixer::IsEquivalentScheme(const std::string& scheme1, |
674 const std::string& scheme2) { | 674 const std::string& scheme2) { |
675 return scheme1 == scheme2 || | 675 return scheme1 == scheme2 || |
676 (scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) || | 676 (scheme1 == url::kAboutScheme && scheme2 == kChromeUIScheme) || |
677 (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme); | 677 (scheme1 == kChromeUIScheme && scheme2 == url::kAboutScheme); |
678 } | 678 } |
OLD | NEW |