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

Side by Side Diff: ios/chrome/app/application_delegate/url_opener.mm

Issue 2621943002: [ObjC ARC] Converts ios/chrome/app/application_delegate:application_delegate_internal to ARC. (Closed)
Patch Set: add dependency on ios/chrome/common/app_group:main_app Created 3 years, 11 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
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/app/application_delegate/url_opener.h" 5 #import "ios/chrome/app/application_delegate/url_opener.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #import "base/ios/weak_nsobject.h"
10 #import "base/mac/scoped_nsobject.h"
11 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
12 #import "ios/chrome/app/application_delegate/app_state.h" 10 #import "ios/chrome/app/application_delegate/app_state.h"
13 #import "ios/chrome/app/application_delegate/startup_information.h" 11 #import "ios/chrome/app/application_delegate/startup_information.h"
14 #import "ios/chrome/app/application_delegate/tab_opening.h" 12 #import "ios/chrome/app/application_delegate/tab_opening.h"
15 #include "ios/chrome/app/chrome_app_startup_parameters.h" 13 #include "ios/chrome/app/chrome_app_startup_parameters.h"
16 14
sdefresne 2017/01/17 14:48:29 Do you forgot to add the ARC guards here?
stkhapugin 2017/01/17 14:53:55 Done.
17 namespace { 15 namespace {
18 // Key of the UMA Startup.MobileSessionStartFromApps histogram. 16 // Key of the UMA Startup.MobileSessionStartFromApps histogram.
19 const char* const kUMAMobileSessionStartFromAppsHistogram = 17 const char* const kUMAMobileSessionStartFromAppsHistogram =
20 "Startup.MobileSessionStartFromApps"; 18 "Startup.MobileSessionStartFromApps";
21 } // namespace 19 } // namespace
22 20
23 @implementation URLOpener 21 @implementation URLOpener
24 22
25 - (instancetype)init { 23 - (instancetype)init {
26 NOTREACHED(); 24 NOTREACHED();
27 return nil; 25 return nil;
28 } 26 }
29 27
30 #pragma mark - ApplicationDelegate - URL Opening methods 28 #pragma mark - ApplicationDelegate - URL Opening methods
31 29
32 + (BOOL)openURL:(NSURL*)url 30 + (BOOL)openURL:(NSURL*)url
33 applicationActive:(BOOL)applicationActive 31 applicationActive:(BOOL)applicationActive
34 options:(NSDictionary<NSString*, id>*)options 32 options:(NSDictionary<NSString*, id>*)options
35 tabOpener:(id<TabOpening>)tabOpener 33 tabOpener:(id<TabOpening>)tabOpener
36 startupInformation:(id<StartupInformation>)startupInformation { 34 startupInformation:(id<StartupInformation>)startupInformation {
37 NSString* sourceApplication = 35 NSString* sourceApplication =
38 options[UIApplicationOpenURLOptionsSourceApplicationKey]; 36 options[UIApplicationOpenURLOptionsSourceApplicationKey];
39 base::scoped_nsobject<ChromeAppStartupParameters> params( 37 ChromeAppStartupParameters* params = [ChromeAppStartupParameters
40 [ChromeAppStartupParameters 38 newChromeAppStartupParametersWithURL:url
41 newChromeAppStartupParametersWithURL:url 39 fromSourceApplication:sourceApplication];
42 fromSourceApplication:sourceApplication]);
43 40
44 MobileSessionCallerApp callerApp = [params callerApp]; 41 MobileSessionCallerApp callerApp = [params callerApp];
45 42
46 UMA_HISTOGRAM_ENUMERATION(kUMAMobileSessionStartFromAppsHistogram, callerApp, 43 UMA_HISTOGRAM_ENUMERATION(kUMAMobileSessionStartFromAppsHistogram, callerApp,
47 MOBILE_SESSION_CALLER_APP_COUNT); 44 MOBILE_SESSION_CALLER_APP_COUNT);
48 45
49 if (startupInformation.isPresentingFirstRunUI) { 46 if (startupInformation.isPresentingFirstRunUI) {
50 UMA_HISTOGRAM_ENUMERATION("FirstRun.LaunchSource", [params launchSource], 47 UMA_HISTOGRAM_ENUMERATION("FirstRun.LaunchSource", [params launchSource],
51 first_run::LAUNCH_SIZE); 48 first_run::LAUNCH_SIZE);
52 } 49 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 BOOL openURLResult = [URLOpener openURL:url 85 BOOL openURLResult = [URLOpener openURL:url
89 applicationActive:applicationActive 86 applicationActive:applicationActive
90 options:options 87 options:options
91 tabOpener:tabOpener 88 tabOpener:tabOpener
92 startupInformation:startupInformation]; 89 startupInformation:startupInformation];
93 [appState launchFromURLHandled:openURLResult]; 90 [appState launchFromURLHandled:openURLResult];
94 } 91 }
95 } 92 }
96 93
97 @end 94 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698