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

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

Issue 28310: Fixes Issue 7377: Regression: Omnibox trims URL ending with 0x85 (Take 2)... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
« no previous file with comments | « base/string_util_unittest.cc ('k') | chrome/browser/net/url_fixer_upper_unittest.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "chrome/browser/net/url_fixer_upper.h" 7 #include "chrome/browser/net/url_fixer_upper.h"
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 return true; 259 return true;
260 } 260 }
261 261
262 string URLFixerUpper::SegmentURL(const string& text, 262 string URLFixerUpper::SegmentURL(const string& text,
263 url_parse::Parsed* parts) { 263 url_parse::Parsed* parts) {
264 // Initialize the result. 264 // Initialize the result.
265 *parts = url_parse::Parsed(); 265 *parts = url_parse::Parsed();
266 266
267 string trimmed; 267 string trimmed;
268 TrimWhitespace(text, TRIM_ALL, &trimmed); 268 TrimWhitespaceUTF8(text, TRIM_ALL, &trimmed);
269 if (trimmed.empty()) 269 if (trimmed.empty())
270 return string(); // Nothing to segment. 270 return string(); // Nothing to segment.
271 271
272 #if defined(OS_WIN) 272 #if defined(OS_WIN)
273 int trimmed_length = static_cast<int>(trimmed.length()); 273 int trimmed_length = static_cast<int>(trimmed.length());
274 if (url_parse::DoesBeginWindowsDriveSpec(trimmed.data(), 0, trimmed_length) || 274 if (url_parse::DoesBeginWindowsDriveSpec(trimmed.data(), 0, trimmed_length) ||
275 url_parse::DoesBeginUNCPath(trimmed.data(), 0, trimmed_length, false)) 275 url_parse::DoesBeginUNCPath(trimmed.data(), 0, trimmed_length, false))
276 return "file"; 276 return "file";
277 #elif defined(OS_POSIX) 277 #elif defined(OS_POSIX)
278 if (FilePath::IsSeparator(trimmed.c_str()[0])) 278 if (FilePath::IsSeparator(trimmed.c_str()[0]))
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 } 473 }
474 wstring URLFixerUpper::FixupURL(const wstring& text, 474 wstring URLFixerUpper::FixupURL(const wstring& text,
475 const wstring& desired_tld) { 475 const wstring& desired_tld) {
476 return UTF8ToWide(FixupURL(WideToUTF8(text), WideToUTF8(desired_tld))); 476 return UTF8ToWide(FixupURL(WideToUTF8(text), WideToUTF8(desired_tld)));
477 } 477 }
478 wstring URLFixerUpper::FixupRelativeFile(const wstring& base_dir, 478 wstring URLFixerUpper::FixupRelativeFile(const wstring& base_dir,
479 const wstring& text) { 479 const wstring& text) {
480 return UTF8ToWide(FixupRelativeFile(FilePath::FromWStringHack(base_dir), 480 return UTF8ToWide(FixupRelativeFile(FilePath::FromWStringHack(base_dir),
481 FilePath::FromWStringHack(text))); 481 FilePath::FromWStringHack(text)));
482 } 482 }
OLDNEW
« no previous file with comments | « base/string_util_unittest.cc ('k') | chrome/browser/net/url_fixer_upper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698