Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Unified Diff: chrome/browser/cocoa/autocomplete_text_field_editor.h

Issue 159018: [Mac] Strip newlines from paste. (Closed)
Patch Set: Test empty clipboard Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field.mm ('k') | chrome/browser/cocoa/autocomplete_text_field_editor.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698