Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
| OLD | NEW |