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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm

Issue 6306011: Remove wstring from autocomplete. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/autocomplete/autocomplete_popup_view_mac.mm
===================================================================
--- chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (revision 72388)
+++ chrome/browser/autocomplete/autocomplete_popup_view_mac.mm (working copy)
@@ -102,14 +102,14 @@
// and description cases. Returns NSMutableAttributedString as a
// convenience for MatchText().
NSMutableAttributedString* AutocompletePopupViewMac::DecorateMatchedString(
- const std::wstring &matchString,
+ const string16 &matchString,
const AutocompleteMatch::ACMatchClassifications &classifications,
NSColor* textColor, NSColor* dimTextColor, gfx::Font& font) {
// Cache for on-demand computation of the bold version of |font|.
NSFont* boldFont = nil;
// Start out with a string using the default style info.
- NSString* s = base::SysWideToNSString(matchString);
+ NSString* s = base::SysUTF16ToNSString(matchString);
NSDictionary* attributes = [NSDictionary dictionaryWithObjectsAndKeys:
font.GetNativeFont(), NSFontAttributeName,
textColor, NSForegroundColorAttributeName,
@@ -154,7 +154,7 @@
NSMutableAttributedString* AutocompletePopupViewMac::ElideString(
NSMutableAttributedString* aString,
- const std::wstring originalString,
+ const string16 originalString,
const gfx::Font& font,
const float width) {
// If it already fits, nothing to be done.
@@ -163,8 +163,7 @@
}
// If ElideText() decides to do nothing, nothing to be done.
- const std::wstring elided(UTF16ToWideHack(ui::ElideText(
- WideToUTF16Hack(originalString), font, width, false)));
+ const string16 elided = ui::ElideText(originalString, font, width, false);
if (0 == elided.compare(originalString)) {
return aString;
}
@@ -181,7 +180,7 @@
DCHECK(0 != elided.compare(0, i, originalString));
// Replace the end of |aString| with the ellipses from |elided|.
- NSString* s = base::SysWideToNSString(elided.substr(i));
+ NSString* s = base::SysUTF16ToNSString(elided.substr(i));
[aString replaceCharactersInRange:NSMakeRange(i, [aString length] - i)
withString:s];
@@ -548,10 +547,10 @@
// completes.
const AutocompleteMatch& match = model_->result().match_at(row);
const GURL url(match.destination_url);
- std::wstring keyword;
+ string16 keyword;
const bool is_keyword_hint = model_->GetKeywordForMatch(match, &keyword);
edit_view_->OpenURL(url, disposition, match.transition, GURL(), row,
- is_keyword_hint ? std::wstring() : keyword);
+ is_keyword_hint ? string16() : keyword);
}
void AutocompletePopupViewMac::UserPressedOptIn(bool opt_in) {

Powered by Google App Engine
This is Rietveld 408576698