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

Unified Diff: chrome/browser/cocoa/autocomplete_text_field.mm

Issue 337027: [Mac] Adjust Omnibox implementation to not break undo chain. (Closed)
Patch Set: Tweak a comment Created 11 years, 2 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/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
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field.h ('k') | chrome/browser/cocoa/autocomplete_text_field_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698