OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_AUTOCOMPLETE_TEXT_FIELD_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 6 #define CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 AutocompleteTextFieldObserver* observer_; // weak, owned by location bar. | 111 AutocompleteTextFieldObserver* observer_; // weak, owned by location bar. |
112 | 112 |
113 // Handles being a drag-and-drop target. | 113 // Handles being a drag-and-drop target. |
114 scoped_nsobject<URLDropTargetHandler> dropHandler_; | 114 scoped_nsobject<URLDropTargetHandler> dropHandler_; |
115 | 115 |
116 // Holds current tooltip strings, to keep them from being dealloced. | 116 // Holds current tooltip strings, to keep them from being dealloced. |
117 scoped_nsobject<NSMutableArray> currentToolTips_; | 117 scoped_nsobject<NSMutableArray> currentToolTips_; |
118 } | 118 } |
119 | 119 |
120 @property (nonatomic) AutocompleteTextFieldObserver* observer; | 120 @property(nonatomic) AutocompleteTextFieldObserver* observer; |
121 | 121 |
122 // Convenience method to return the cell, casted appropriately. | 122 // Convenience method to return the cell, casted appropriately. |
123 - (AutocompleteTextFieldCell*)cell; | 123 - (AutocompleteTextFieldCell*)cell; |
124 | 124 |
125 // Superclass aborts editing before changing the string, which causes | 125 // Superclass aborts editing before changing the string, which causes |
126 // problems for undo. This version modifies the field editor's | 126 // problems for undo. This version modifies the field editor's |
127 // contents if the control is already being edited. | 127 // contents if the control is already being edited. |
128 - (void)setAttributedStringValue:(NSAttributedString*)aString; | 128 - (void)setAttributedStringValue:(NSAttributedString*)aString; |
129 | 129 |
130 // Clears the undo chain for this text field. | 130 // Clears the undo chain for this text field. |
131 - (void)clearUndoChain; | 131 - (void)clearUndoChain; |
132 | 132 |
133 // Updates cursor and tooltip rects depending on the contents of the text field | 133 // Updates cursor and tooltip rects depending on the contents of the text field |
134 // e.g. the security icon should have a default pointer shown on hover instead | 134 // e.g. the security icon should have a default pointer shown on hover instead |
135 // of an I-beam. | 135 // of an I-beam. |
136 - (void)updateCursorAndToolTipRects; | 136 - (void)updateCursorAndToolTipRects; |
137 | 137 |
138 // Return the appropriate menu for any decoration under |event|. | 138 // Return the appropriate menu for any decoration under |event|. |
139 - (NSMenu*)decorationMenuForEvent:(NSEvent*)event; | 139 - (NSMenu*)decorationMenuForEvent:(NSEvent*)event; |
140 | 140 |
141 // Retains |tooltip| (in |currentToolTips_|) and adds this tooltip | 141 // Retains |tooltip| (in |currentToolTips_|) and adds this tooltip |
142 // via -[NSView addToolTipRect:owner:userData:]. | 142 // via -[NSView addToolTipRect:owner:userData:]. |
143 - (void)addToolTip:(NSString*)tooltip forRect:(NSRect)aRect; | 143 - (void)addToolTip:(NSString*)tooltip forRect:(NSRect)aRect; |
144 | 144 |
145 @end | 145 @end |
146 | 146 |
147 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 147 #endif // CHROME_BROWSER_UI_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
OLD | NEW |