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

Side by Side Diff: ui/base/clipboard/clipboard_util_mac.mm

Issue 1841813002: Update AutocompleteTextFieldEditor to use non-deprecated dragging APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from avi. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ui/base/clipboard/clipboard_util_mac.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "ui/base/clipboard/clipboard_util_mac.h" 5 #include "ui/base/clipboard/clipboard_util_mac.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/mac/scoped_cftyperef.h" 8 #include "base/mac/scoped_cftyperef.h"
9 9
10 namespace { 10 namespace {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 [item setString:urlString forType:UTIFromPboardType(NSStringPboardType)]; 70 [item setString:urlString forType:UTIFromPboardType(NSStringPboardType)];
71 71
72 [item setData:[urlString dataUsingEncoding:NSUTF8StringEncoding] 72 [item setData:[urlString dataUsingEncoding:NSUTF8StringEncoding]
73 forType:UTIFromPboardType(kCorePasteboardFlavorType_url)]; 73 forType:UTIFromPboardType(kCorePasteboardFlavorType_url)];
74 74
75 [item setData:[title dataUsingEncoding:NSUTF8StringEncoding] 75 [item setData:[title dataUsingEncoding:NSUTF8StringEncoding]
76 forType:UTIFromPboardType(kCorePasteboardFlavorType_urln)]; 76 forType:UTIFromPboardType(kCorePasteboardFlavorType_urln)];
77 return item; 77 return item;
78 } 78 }
79 79
80 // static
81 base::scoped_nsobject<NSPasteboardItem> ClipboardUtil::PasteboardItemFromString(
82 NSString* string) {
83 base::scoped_nsobject<NSPasteboardItem> item([[NSPasteboardItem alloc] init]);
84 [item setString:string forType:UTIFromPboardType(NSStringPboardType)];
85 return item;
86 }
87
88 //static
89 NSString* ClipboardUtil::GetTitleFromPasteboardURL(NSPasteboard* pboard) {
90 return
91 [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_urln)];
92 }
93
94 //static
95 NSString* ClipboardUtil::GetURLFromPasteboardURL(NSPasteboard* pboard) {
96 return
97 [pboard stringForType:UTIFromPboardType(kCorePasteboardFlavorType_url)];
98 }
99
80 } // namespace ui 100 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_util_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698