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

Side by Side Diff: ios/chrome/browser/open_url_util.mm

Issue 2566993002: [ObjC ARC] Converts ios/chrome/browser:browser to ARC. (Closed)
Patch Set: comments Created 4 years 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/ios_chrome_io_thread.mm ('k') | ios/chrome/browser/root_coordinator.h » ('j') | 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 #import "ios/chrome/browser/open_url_util.h" 5 #import "ios/chrome/browser/open_url_util.h"
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #include "base/ios/ios_util.h" 9 #include "base/ios/ios_util.h"
10 10
11 #if !defined(__has_feature) || !__has_feature(objc_arc)
12 #error "This file requires ARC support."
13 #endif
14
11 void OpenUrlWithCompletionHandler(NSURL* url, 15 void OpenUrlWithCompletionHandler(NSURL* url,
12 void (^completion_handler)(BOOL success)) { 16 void (^completion_handler)(BOOL success)) {
13 if (base::ios::IsRunningOnIOS10OrLater()) { 17 if (base::ios::IsRunningOnIOS10OrLater()) {
14 [[UIApplication sharedApplication] openURL:url 18 [[UIApplication sharedApplication] openURL:url
15 options:@{} 19 options:@{}
16 completionHandler:completion_handler]; 20 completionHandler:completion_handler];
17 } else { 21 } else {
18 BOOL result = [[UIApplication sharedApplication] openURL:url]; 22 BOOL result = [[UIApplication sharedApplication] openURL:url];
19 if (!completion_handler) 23 if (!completion_handler)
20 return; 24 return;
21 dispatch_async(dispatch_get_main_queue(), ^{ 25 dispatch_async(dispatch_get_main_queue(), ^{
22 completion_handler(result); 26 completion_handler(result);
23 }); 27 });
24 } 28 }
25 } 29 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/ios_chrome_io_thread.mm ('k') | ios/chrome/browser/root_coordinator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698