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

Side by Side Diff: chrome/browser/cocoa/autocomplete_text_field.mm

Issue 246009: [Mac] Support undo in the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« 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