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

Unified Diff: chrome/browser/ui/elide_url.cc

Issue 1240183002: Update SplitString calls in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/elide_url.cc
diff --git a/chrome/browser/ui/elide_url.cc b/chrome/browser/ui/elide_url.cc
index afa6d7a880abc4916742a14268cf672da2e5d4f9..b5c7ca6e67fdd248719846556e1fa787fb2a1f33 100644
--- a/chrome/browser/ui/elide_url.cc
+++ b/chrome/browser/ui/elide_url.cc
@@ -156,14 +156,14 @@ base::string16 ElideUrl(const GURL& url,
// domain is now C: - this is a nice hack for eliding to work pleasantly.
if (url.SchemeIsFile()) {
// Split the path string using ":"
- std::vector<base::string16> file_path_split;
- base::SplitString(url_path, ':', &file_path_split);
+ const base::string16 kColon(1, ':');
+ std::vector<base::string16> file_path_split = base::SplitString(
+ url_path, kColon, base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (file_path_split.size() > 1) { // File is of type "file:///C:/.."
url_host.clear();
url_domain.clear();
url_subdomain.clear();
- const base::string16 kColon = UTF8ToUTF16(":");
url_host = url_domain = file_path_split.at(0).substr(1) + kColon;
url_path_query_etc = url_path = file_path_split.at(1);
}
@@ -201,8 +201,9 @@ base::string16 ElideUrl(const GURL& url,
}
// Parse url_path using '/'.
- std::vector<base::string16> url_path_elements;
- base::SplitString(url_path, kForwardSlash, &url_path_elements);
+ std::vector<base::string16> url_path_elements = base::SplitString(
+ url_path, base::string16(1, kForwardSlash),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Get filename - note that for a path ending with /
// such as www.google.com/intl/ads/, the file name is ads/.
« no previous file with comments | « chrome/browser/ui/autofill/generated_credit_card_bubble_controller.cc ('k') | chrome/browser/ui/libgtk2ui/gtk2_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698