OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/tabs/tab.h" | 5 #import "ios/chrome/browser/tabs/tab.h" |
6 | 6 |
7 #import <CoreLocation/CoreLocation.h> | 7 #import <CoreLocation/CoreLocation.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 } | 1840 } |
1841 | 1841 |
1842 - (BOOL)urlTriggersNativeAppLaunch:(const GURL&)url | 1842 - (BOOL)urlTriggersNativeAppLaunch:(const GURL&)url |
1843 sourceURL:(const GURL&)sourceURL | 1843 sourceURL:(const GURL&)sourceURL |
1844 linkClicked:(BOOL)linkClicked { | 1844 linkClicked:(BOOL)linkClicked { |
1845 // Don't open any native app directly when prerendering or from Incognito. | 1845 // Don't open any native app directly when prerendering or from Incognito. |
1846 if (isPrerenderTab_ || self.browserState->IsOffTheRecord()) | 1846 if (isPrerenderTab_ || self.browserState->IsOffTheRecord()) |
1847 return NO; | 1847 return NO; |
1848 | 1848 |
1849 base::scoped_nsprotocol<id<NativeAppMetadata>> metadata( | 1849 base::scoped_nsprotocol<id<NativeAppMetadata>> metadata( |
1850 [ios::GetChromeBrowserProvider()->GetNativeAppWhitelistManager() | 1850 [[ios::GetChromeBrowserProvider()->GetNativeAppWhitelistManager() |
1851 newNativeAppForURL:url]); | 1851 nativeAppForURL:url] retain]); |
1852 if (![metadata shouldAutoOpenLinks]) | 1852 if (![metadata shouldAutoOpenLinks]) |
1853 return NO; | 1853 return NO; |
1854 | 1854 |
1855 AuthenticationService* authenticationService = | 1855 AuthenticationService* authenticationService = |
1856 AuthenticationServiceFactory::GetForBrowserState(self.browserState); | 1856 AuthenticationServiceFactory::GetForBrowserState(self.browserState); |
1857 ChromeIdentity* identity = authenticationService->GetAuthenticatedIdentity(); | 1857 ChromeIdentity* identity = authenticationService->GetAuthenticatedIdentity(); |
1858 | 1858 |
1859 // Attempts to open external app without x-callback. | 1859 // Attempts to open external app without x-callback. |
1860 if ([self openExternalURL:[metadata launchURLWithURL:url identity:identity] | 1860 if ([self openExternalURL:[metadata launchURLWithURL:url identity:identity] |
1861 linkClicked:linkClicked]) { | 1861 linkClicked:linkClicked]) { |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2257 | 2257 |
2258 - (TabModel*)parentTabModel { | 2258 - (TabModel*)parentTabModel { |
2259 return parentTabModel_; | 2259 return parentTabModel_; |
2260 } | 2260 } |
2261 | 2261 |
2262 - (FormInputAccessoryViewController*)inputAccessoryViewController { | 2262 - (FormInputAccessoryViewController*)inputAccessoryViewController { |
2263 return inputAccessoryViewController_.get(); | 2263 return inputAccessoryViewController_.get(); |
2264 } | 2264 } |
2265 | 2265 |
2266 @end | 2266 @end |
OLD | NEW |