| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "chrome/browser/cocoa/autocomplete_text_field.h" | 5 #import "chrome/browser/cocoa/autocomplete_text_field.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/cocoa/autocomplete_text_field_cell.h" | 8 #import "chrome/browser/cocoa/autocomplete_text_field_cell.h" |
| 9 | 9 |
| 10 @implementation AutocompleteTextField | 10 @implementation AutocompleteTextField |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // -currentEditor is defined to return NSText*, make sure our | 153 // -currentEditor is defined to return NSText*, make sure our |
| 154 // assumptions still hold, here. | 154 // assumptions still hold, here. |
| 155 DCHECK([editor isKindOfClass:[NSTextView class]]); | 155 DCHECK([editor isKindOfClass:[NSTextView class]]); |
| 156 | 156 |
| 157 NSTextStorage* textStorage = [editor textStorage]; | 157 NSTextStorage* textStorage = [editor textStorage]; |
| 158 DCHECK(textStorage); | 158 DCHECK(textStorage); |
| 159 [textStorage setAttributedString:aString]; | 159 [textStorage setAttributedString:aString]; |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 | 162 |
| 163 - (NSUndoManager*)undoManagerForTextView:(NSTextView*)textView { |
| 164 if (!undoManager_.get()) |
| 165 undoManager_.reset([[NSUndoManager alloc] init]); |
| 166 return undoManager_.get(); |
| 167 } |
| 168 |
| 169 - (void)clearUndoChain { |
| 170 [undoManager_ removeAllActions]; |
| 171 } |
| 172 |
| 163 @end | 173 @end |
| OLD | NEW |