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

Side by Side Diff: ios/web/shell/view_controller.mm

Issue 2275303004: Context menu egtests, plus related utilities. (Closed)
Patch Set: Fewer References. Created 4 years, 3 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/web/shell/test/earl_grey/shell_matchers.mm ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ios/web/shell/view_controller.h" 5 #import "ios/web/shell/view_controller.h"
6 6
7 #import <MobileCoreServices/MobileCoreServices.h> 7 #import <MobileCoreServices/MobileCoreServices.h>
8 8
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 CGRectMake(params.location.x, params.location.y, 1.0, 1.0); 306 CGRectMake(params.location.x, params.location.y, 1.0, 1.0);
307 307
308 void (^handler)(UIAlertAction*) = ^(UIAlertAction*) { 308 void (^handler)(UIAlertAction*) = ^(UIAlertAction*) {
309 NSDictionary* item = @{ 309 NSDictionary* item = @{
310 static_cast<NSString*>(kUTTypeURL) : net::NSURLWithGURL(link), 310 static_cast<NSString*>(kUTTypeURL) : net::NSURLWithGURL(link),
311 static_cast<NSString*>(kUTTypeUTF8PlainText) : [base::SysUTF8ToNSString( 311 static_cast<NSString*>(kUTTypeUTF8PlainText) : [base::SysUTF8ToNSString(
312 link.spec()) dataUsingEncoding:NSUTF8StringEncoding], 312 link.spec()) dataUsingEncoding:NSUTF8StringEncoding],
313 }; 313 };
314 [[UIPasteboard generalPasteboard] setItems:@[ item ]]; 314 [[UIPasteboard generalPasteboard] setItems:@[ item ]];
315 }; 315 };
316 [alert addAction:[UIAlertAction actionWithTitle:@"Copy" 316 [alert addAction:[UIAlertAction actionWithTitle:@"Copy Link"
317 style:UIAlertActionStyleDefault 317 style:UIAlertActionStyleDefault
318 handler:handler]]; 318 handler:handler]];
319 319
320 [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" 320 [alert addAction:[UIAlertAction actionWithTitle:@"Cancel"
321 style:UIAlertActionStyleCancel 321 style:UIAlertActionStyleCancel
322 handler:nil]]; 322 handler:nil]];
323 323
324 [self presentViewController:alert animated:YES completion:nil]; 324 [self presentViewController:alert animated:YES completion:nil];
325 325
326 return YES; 326 return YES;
327 } 327 }
328 328
329 @end 329 @end
OLDNEW
« no previous file with comments | « ios/web/shell/test/earl_grey/shell_matchers.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698