Index: chrome/browser/cocoa/autocomplete_text_field_editor.h |
diff --git a/chrome/browser/cocoa/autocomplete_text_field_editor.h b/chrome/browser/cocoa/autocomplete_text_field_editor.h |
index 1d4d0735d699e1f6ee5346200347a28b260667a3..640bb9bc95a4f871c3a1cb8b65e073e05289467b 100644 |
--- a/chrome/browser/cocoa/autocomplete_text_field_editor.h |
+++ b/chrome/browser/cocoa/autocomplete_text_field_editor.h |
@@ -4,6 +4,16 @@ |
#import <Cocoa/Cocoa.h> |
+@protocol AutocompleteTextFieldEditorDelegateMethods |
+ |
+// Delegate -paste: implementation to the field being edited. If the |
+// delegate returns YES, or does not implement the method, NSTextView |
+// is called to handle the paste. The delegate can block the paste |
+// (or handle it internally) by returning NO. |
+- (BOOL)textShouldPaste:(NSText*)fieldEditor; |
+ |
+@end |
+ |
// Field editor used for the autocomplete field. |
@interface AutocompleteTextFieldEditor : NSTextView { |
} |
@@ -14,4 +24,9 @@ |
// Same as above, note that this calls through to performCopy. |
- (void)performCut:(NSPasteboard*)pb; |
+ |
+// Called by -paste: to decide whether to forward to superclass. |
+// Exposed for unit testing. |
+- (BOOL)shouldPaste; |
+ |
@end |