Index: ios/chrome/browser/tabs/tab.mm |
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm |
index 7baddb0dfbe8084f82e922feb61022d20195d6b9..a0a7fe0a2ecbc1271994827070aa62f7405403ae 100644 |
--- a/ios/chrome/browser/tabs/tab.mm |
+++ b/ios/chrome/browser/tabs/tab.mm |
@@ -478,7 +478,8 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
initWithSnapshotManager:snapshotManager_ |
tab:self]; |
- [self initNativeAppNavigationController]; |
+ if (experimental_flags::IsNativeAppLauncherEnabled()) |
+ [self initNativeAppNavigationController]; |
[[NSNotificationCenter defaultCenter] |
addObserver:self |
@@ -1551,6 +1552,12 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
- (BOOL)urlTriggersNativeAppLaunch:(const GURL&)url |
sourceURL:(const GURL&)sourceURL |
linkClicked:(BOOL)linkClicked { |
+ // TODO(crbug/711511): If Native App Launcher is not enabled, returning NO to |
rohitrao (ping after 24h)
2017/05/03 22:53:07
Remove "to"
pkl (ping after 24h if needed)
2017/05/03 23:20:01
Done.
|
+ // bypasses all Link Navigation logic. This call should eventually be |
+ // eliminated. |
+ if (!experimental_flags::IsNativeAppLauncherEnabled()) |
+ return NO; |
+ |
// Don't open any native app directly when prerendering or from Incognito. |
if (isPrerenderTab_ || self.browserState->IsOffTheRecord()) |
return NO; |
@@ -1837,6 +1844,10 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
} |
- (NativeAppNavigationController*)nativeAppNavigationController { |
+ // TODO(crbug.com/711511): If Native App Launcher is not enabled, simply |
+ // return nil here. This method should eventually be eliminated. |
+ if (!experimental_flags::IsNativeAppLauncherEnabled()) |
+ return nil; |
return nativeAppNavigationController_; |
} |