| 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_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 5 #ifndef CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| 6 #define CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 6 #define CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 @class AutocompleteTextFieldCell; | 10 @class AutocompleteTextFieldCell; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // AutocompleteTextFieldDelegateMethods are meant to be similar to | 26 // AutocompleteTextFieldDelegateMethods are meant to be similar to |
| 27 // NSControl delegate methods, adding additional intercepts relevant | 27 // NSControl delegate methods, adding additional intercepts relevant |
| 28 // to the Omnibox implementation. | 28 // to the Omnibox implementation. |
| 29 | 29 |
| 30 @protocol AutocompleteTextFieldDelegateMethods | 30 @protocol AutocompleteTextFieldDelegateMethods |
| 31 | 31 |
| 32 // Delegate -textShouldPaste: implementation to the field being | 32 // Delegate -textShouldPaste: implementation to the field being |
| 33 // edited. See AutocompleteTextFieldEditor implementation. | 33 // edited. See AutocompleteTextFieldEditor implementation. |
| 34 - (BOOL)control:(NSControl*)control textShouldPaste:(NSText*)fieldEditor; | 34 - (BOOL)control:(NSControl*)control textShouldPaste:(NSText*)fieldEditor; |
| 35 | 35 |
| 36 // Returns nil if paste actions are not supported. |
| 37 - (NSString*)control:(NSControl*)control |
| 38 textPasteActionString:(NSText*)fieldEditor; |
| 39 - (void)control:(NSControl*)control textDidPasteAndGo:(NSText*)fieldEditor; |
| 40 |
| 36 // Let the delegate track -flagsChanged: events. | 41 // Let the delegate track -flagsChanged: events. |
| 37 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent; | 42 - (void)control:(NSControl*)control flagsChanged:(NSEvent*)theEvent; |
| 38 | 43 |
| 39 @end | 44 @end |
| 40 | 45 |
| 41 @interface AutocompleteTextField : NSTextField { | 46 @interface AutocompleteTextField : NSTextField { |
| 42 } | 47 } |
| 43 | 48 |
| 44 - (BOOL)textShouldPaste:(NSText*)fieldEditor; | 49 - (BOOL)textShouldPaste:(NSText*)fieldEditor; |
| 45 | 50 |
| 46 // Convenience method to return the cell, casted appropriately. | 51 // Convenience method to return the cell, casted appropriately. |
| 47 - (AutocompleteTextFieldCell*)autocompleteTextFieldCell; | 52 - (AutocompleteTextFieldCell*)autocompleteTextFieldCell; |
| 48 | 53 |
| 49 // If the keyword, keyword hint, or search hint changed, then the | 54 // If the keyword, keyword hint, or search hint changed, then the |
| 50 // field needs to be relaidout. This accomplishes that in a manner | 55 // field needs to be relaidout. This accomplishes that in a manner |
| 51 // which doesn't disrupt the field delegate. | 56 // which doesn't disrupt the field delegate. |
| 52 - (void)resetFieldEditorFrameIfNeeded; | 57 - (void)resetFieldEditorFrameIfNeeded; |
| 53 | 58 |
| 54 @end | 59 @end |
| 55 | 60 |
| 56 #endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ | 61 #endif // CHROME_BROWSER_COCOA_AUTOCOMPLETE_TEXT_FIELD_H_ |
| OLD | NEW |