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 #include "chrome/browser/cocoa/autocomplete_text_field.h" | 5 #include "chrome/browser/cocoa/autocomplete_text_field.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h" | 8 #include "chrome/browser/cocoa/autocomplete_text_field_cell.h" |
9 | 9 |
10 @implementation AutocompleteTextField | 10 @implementation AutocompleteTextField |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 if (observer_) { | 186 if (observer_) { |
187 observer_->OnFrameChanged(); | 187 observer_->OnFrameChanged(); |
188 } | 188 } |
189 } | 189 } |
190 | 190 |
191 // Due to theming, parts of the field are transparent. | 191 // Due to theming, parts of the field are transparent. |
192 - (BOOL)isOpaque { | 192 - (BOOL)isOpaque { |
193 return NO; | 193 return NO; |
194 } | 194 } |
195 | 195 |
| 196 - (void)setAttributedStringValue:(NSAttributedString*)aString { |
| 197 NSTextView* editor = static_cast<NSTextView*>([self currentEditor]); |
| 198 if (!editor) { |
| 199 [super setAttributedStringValue:aString]; |
| 200 } else { |
| 201 // -currentEditor is defined to return NSText*, make sure our |
| 202 // assumptions still hold, here. |
| 203 DCHECK([editor isKindOfClass:[NSTextView class]]); |
| 204 |
| 205 NSTextStorage* textStorage = [editor textStorage]; |
| 206 DCHECK(textStorage); |
| 207 [textStorage setAttributedString:aString]; |
| 208 } |
| 209 } |
| 210 |
196 @end | 211 @end |
OLD | NEW |