| 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 #import "chrome/browser/cocoa/autocomplete_text_field_editor.h" | 5 #import "chrome/browser/cocoa/autocomplete_text_field_editor.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
| 9 | 9 |
| 10 @implementation AutocompleteTextFieldEditor | 10 @implementation AutocompleteTextFieldEditor |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 [pb declareTypes:[NSArray array] owner:nil]; | 23 [pb declareTypes:[NSArray array] owner:nil]; |
| 24 [self writeSelectionToPasteboard:pb types: | 24 [self writeSelectionToPasteboard:pb types: |
| 25 [NSArray arrayWithObject:NSStringPboardType]]; | 25 [NSArray arrayWithObject:NSStringPboardType]]; |
| 26 } | 26 } |
| 27 | 27 |
| 28 - (void)performCut:(NSPasteboard*)pb { | 28 - (void)performCut:(NSPasteboard*)pb { |
| 29 [self performCopy:pb]; | 29 [self performCopy:pb]; |
| 30 [self delete:nil]; | 30 [self delete:nil]; |
| 31 } | 31 } |
| 32 | 32 |
| 33 - (BOOL)shouldPaste { |
| 34 id delegate = [self delegate]; |
| 35 if (![delegate respondsToSelector:@selector(textShouldPaste:)] || |
| 36 [delegate textShouldPaste:self]) { |
| 37 return YES; |
| 38 } |
| 39 return NO; |
| 40 } |
| 41 |
| 42 - (void)paste:(id)sender { |
| 43 if ([self shouldPaste]) { |
| 44 [super paste:sender]; |
| 45 } |
| 46 } |
| 47 |
| 33 @end | 48 @end |
| OLD | NEW |