OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/autocomplete_text_field_editor.h" |
| 6 |
| 7 #include "base/string_util.h" |
| 8 #include "base/sys_string_conversions.h" |
| 9 |
| 10 @implementation AutocompleteTextFieldEditor |
| 11 |
| 12 - (void)copy:(id)sender { |
| 13 NSPasteboard* pb = [NSPasteboard generalPasteboard]; |
| 14 [self performCopy:pb]; |
| 15 } |
| 16 |
| 17 - (void)cut:(id)sender { |
| 18 NSPasteboard* pb = [NSPasteboard generalPasteboard]; |
| 19 [self performCut:pb]; |
| 20 } |
| 21 |
| 22 - (void)performCopy:(NSPasteboard*)pb { |
| 23 [pb declareTypes:[NSArray array] owner:nil]; |
| 24 [self writeSelectionToPasteboard:pb types: |
| 25 [NSArray arrayWithObject:NSStringPboardType]]; |
| 26 } |
| 27 |
| 28 - (void)performCut:(NSPasteboard*)pb { |
| 29 [self performCopy:pb]; |
| 30 [self delete:nil]; |
| 31 } |
| 32 |
| 33 @end |
OLD | NEW |