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

Side by Side Diff: ios/chrome/browser/ui/clipboard_util.mm

Issue 2659693004: Add context menu when long press on a reading list entry (Closed)
Patch Set: Address comment Created 3 years, 10 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
OLDNEW
(Empty)
1 // Copyright 2017 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 "ios/chrome/browser/ui/clipboard_util.h"
6
7 #import <MobileCoreServices/MobileCoreServices.h>
8 #import <UIKit/UIKit.h>
9
10 #include "base/strings/sys_string_conversions.h"
11 #import "net/base/mac/url_conversions.h"
12 #include "url/gurl.h"
13
14 void StoreURLInPasteboard(const GURL& URL) {
Olivier 2017/02/01 12:22:05 nit: choose pasteboard or clipboard for name of me
gambard 2017/02/01 17:13:37 Done.
15 DCHECK(URL.is_valid());
16 NSData* plainText = [base::SysUTF8ToNSString(URL.spec())
17 dataUsingEncoding:NSUTF8StringEncoding];
18 NSDictionary* copiedItem = @{
19 (NSString*)kUTTypeURL : net::NSURLWithGURL(URL),
20 (NSString*)kUTTypeUTF8PlainText : plainText,
21 };
22 [[UIPasteboard generalPasteboard] setItems:@[ copiedItem ]];
23 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698