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/ui/cocoa/styled_text_field.h" | 5 #import "chrome/browser/ui/cocoa/styled_text_field.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" | 8 #import "chrome/browser/ui/cocoa/styled_text_field_cell.h" |
9 | 9 |
10 @implementation StyledTextField | 10 @implementation StyledTextField |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // Make sure the selection remains visible. | 51 // Make sure the selection remains visible. |
52 [editor scrollRangeToVisible:[editor selectedRange]]; | 52 [editor scrollRangeToVisible:[editor selectedRange]]; |
53 } | 53 } |
54 | 54 |
55 - (CGFloat)availableDecorationWidth { | 55 - (CGFloat)availableDecorationWidth { |
56 NSAttributedString* as = [self attributedStringValue]; | 56 NSAttributedString* as = [self attributedStringValue]; |
57 const NSSize size([as size]); | 57 const NSSize size([as size]); |
58 const NSRect bounds([self bounds]); | 58 const NSRect bounds([self bounds]); |
59 return NSWidth(bounds) - size.width; | 59 return NSWidth(bounds) - size.width; |
60 } | 60 } |
| 61 |
| 62 - (NSFocusRingType)focusRingType { |
| 63 // This is taken care of by the custom drawing code in the cell. |
| 64 return NSFocusRingTypeNone; |
| 65 } |
| 66 |
61 @end | 67 @end |
OLD | NEW |