Index: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
index d61330fc1269c7ad6b5a328b6594c06e22ddf562..793198a1ec2299099cafc0eb49038136c0f7d4e4 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
@@ -296,19 +296,30 @@ bool ShouldOverwriteComboboxes(autofill::DialogSection section, |
- (void)updateSuggestionState { |
const autofill::SuggestionState& suggestionState = |
delegate_->SuggestionStateForSection(section_); |
- // TODO(estade): use |vertically_compact_text| when it fits. |
- const base::string16& text = suggestionState.horizontally_compact_text; |
showSuggestions_ = suggestionState.visible; |
- [suggestContainer_ setSuggestionText:base::SysUTF16ToNSString(text) |
- icon:suggestionState.icon.AsNSImage()]; |
- |
if (!suggestionState.extra_text.empty()) { |
NSString* extraText = |
base::SysUTF16ToNSString(suggestionState.extra_text); |
NSImage* extraIcon = suggestionState.extra_icon.AsNSImage(); |
[suggestContainer_ showInputField:extraText withIcon:extraIcon]; |
} |
+ |
+ // Prefer the vertically compact text when it fits. If it doesn't fit, fall |
+ // back to the horizontally compact text. |
+ NSString* vertically_compact_text = |
+ base::SysUTF16ToNSString(suggestionState.vertically_compact_text); |
+ [suggestContainer_ setSuggestionText:vertically_compact_text |
+ icon:suggestionState.icon.AsNSImage() |
+ wrapText:NO]; |
+ if ([suggestContainer_ preferredSize].width > kDetailsWidth) { |
groby-ooo-7-16
2013/12/14 04:39:19
Shouldn't that logic just happen in the suggestCon
Ilya Sherman
2013/12/14 05:02:27
Done.
|
+ NSString* horizontally_compact_text = |
+ base::SysUTF16ToNSString(suggestionState.horizontally_compact_text); |
+ [suggestContainer_ setSuggestionText:horizontally_compact_text |
+ icon:suggestionState.icon.AsNSImage() |
+ wrapText:YES]; |
+ } |
+ |
[view_ setShouldHighlightOnHover:showSuggestions_]; |
if (showSuggestions_) |
[view_ setClickTarget:suggestButton_]; |