Index: chrome/browser/cocoa/autocomplete_text_field.mm |
diff --git a/chrome/browser/cocoa/autocomplete_text_field.mm b/chrome/browser/cocoa/autocomplete_text_field.mm |
index 3071519b4e27235b6b74aa2257626ff292842330..182a8b32c0fe82dd40500ccef7159c622f973055 100644 |
--- a/chrome/browser/cocoa/autocomplete_text_field.mm |
+++ b/chrome/browser/cocoa/autocomplete_text_field.mm |
@@ -193,4 +193,19 @@ |
return NO; |
} |
+- (void)setAttributedStringValue:(NSAttributedString*)aString { |
+ NSTextView* editor = static_cast<NSTextView*>([self currentEditor]); |
+ if (!editor) { |
+ [super setAttributedStringValue:aString]; |
+ } else { |
+ // -currentEditor is defined to return NSText*, make sure our |
+ // assumptions still hold, here. |
+ DCHECK([editor isKindOfClass:[NSTextView class]]); |
+ |
+ NSTextStorage* textStorage = [editor textStorage]; |
+ DCHECK(textStorage); |
+ [textStorage setAttributedString:aString]; |
+ } |
+} |
+ |
@end |