| 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 #ifndef CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_H_ |
| 7 |
| 5 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 6 | 9 |
| 7 @class StyledTextFieldCell; | 10 @class StyledTextFieldCell; |
| 8 | 11 |
| 9 // An implementation of NSTextField that is designed to work with | 12 // An implementation of NSTextField that is designed to work with |
| 10 // StyledTextFieldCell. Provides methods to redraw the field when cell | 13 // StyledTextFieldCell. Provides methods to redraw the field when cell |
| 11 // decorations have changed and overrides |mouseDown:| to properly handle clicks | 14 // decorations have changed and overrides |mouseDown:| to properly handle clicks |
| 12 // in sections of the cell with decorations. | 15 // in sections of the cell with decorations. |
| 13 @interface StyledTextField : NSTextField { | 16 @interface StyledTextField : NSTextField { |
| 14 } | 17 } |
| 15 | 18 |
| 16 // Repositions and redraws the field editor. Call this method when the cell's | 19 // Repositions and redraws the field editor. Call this method when the cell's |
| 17 // text frame has changed (whenever changing cell decorations). | 20 // text frame has changed (whenever changing cell decorations). |
| 18 - (void)resetFieldEditorFrameIfNeeded; | 21 - (void)resetFieldEditorFrameIfNeeded; |
| 19 | 22 |
| 20 // Returns the amount of the field's width which is not being taken up | 23 // Returns the amount of the field's width which is not being taken up |
| 21 // by the text contents. May be negative if the contents are large | 24 // by the text contents. May be negative if the contents are large |
| 22 // enough to scroll. | 25 // enough to scroll. |
| 23 - (CGFloat)availableDecorationWidth; | 26 - (CGFloat)availableDecorationWidth; |
| 24 | 27 |
| 25 @end | 28 @end |
| 26 | 29 |
| 27 @interface StyledTextField (ExposedForTesting) | 30 @interface StyledTextField (ExposedForTesting) |
| 28 - (StyledTextFieldCell*)styledTextFieldCell; | 31 - (StyledTextFieldCell*)styledTextFieldCell; |
| 29 @end | 32 @end |
| 33 |
| 34 #endif // CHROME_BROWSER_UI_COCOA_STYLED_TEXT_FIELD_H_ |
| OLD | NEW |