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

Unified Diff: chrome/browser/ui/omnibox/location_bar_util.cc

Issue 10219009: Convert CalculateMinString() to string16. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/omnibox/location_bar_util.cc
diff --git a/chrome/browser/ui/omnibox/location_bar_util.cc b/chrome/browser/ui/omnibox/location_bar_util.cc
index 018553e344ad66b58e555260bcb7ffbdc6744786..b1c70261f79e21985d885db74e81f3cc2ad964c6 100644
--- a/chrome/browser/ui/omnibox/location_bar_util.cc
+++ b/chrome/browser/ui/omnibox/location_bar_util.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -27,20 +27,20 @@ std::wstring GetKeywordName(Profile* profile, const std::wstring& keyword) {
return std::wstring();
}
-std::wstring CalculateMinString(const std::wstring& description) {
+string16 CalculateMinString(const string16& description) {
// Chop at the first '.' or whitespace.
const size_t dot_index = description.find('.');
- const size_t ws_index = description.find_first_of(kWhitespaceWide);
+ const size_t ws_index = description.find_first_of(kWhitespaceUTF16);
size_t chop_index = std::min(dot_index, ws_index);
string16 min_string;
- if (chop_index == std::wstring::npos) {
+ if (chop_index == string16::npos) {
// No dot or whitespace, truncate to at most 3 chars.
- min_string = ui::TruncateString(WideToUTF16Hack(description), 3);
+ min_string = ui::TruncateString(description, 3);
} else {
- min_string = WideToUTF16(description.substr(0, chop_index));
+ min_string = description.substr(0, chop_index);
}
base::i18n::AdjustStringForLocaleDirection(&min_string);
- return UTF16ToWide(min_string);
+ return min_string;
}
} // namespace location_bar_util

Powered by Google App Engine
This is Rietveld 408576698