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

Side by Side Diff: ios/chrome/browser/ui/util/pasteboard_util.mm

Issue 2659693004: Add context menu when long press on a reading list entry (Closed)
Patch Set: Address comments 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
« no previous file with comments | « ios/chrome/browser/ui/util/pasteboard_util.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/util/pasteboard_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) {
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
« no previous file with comments | « ios/chrome/browser/ui/util/pasteboard_util.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698