Index: ios/chrome/browser/tabs/tab.mm |
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm |
index a6eda18221461e7f4268aae932b9dd11ecab1fdc..5148129643a2544142f5da9c9c146cf425cc2e54 100644 |
--- a/ios/chrome/browser/tabs/tab.mm |
+++ b/ios/chrome/browser/tabs/tab.mm |
@@ -1567,13 +1567,16 @@ - (void)openAppStore:(NSString*)appId { |
[storeKitLauncher_ openAppStore:appId]; |
} |
-- (BOOL)useDesktopUserAgent { |
- web::NavigationItem* currentItem = self.currentNavigationItem; |
- return currentItem && currentItem->IsOverridingUserAgent(); |
+- (BOOL)usesDesktopUserAgent { |
+ if (![self navigationManager]) |
Eugene But (OOO till 7-30)
2017/02/23 18:00:11
nit: self.navigationManager because it's a propert
liaoyuke
2017/02/23 18:37:11
Done.
|
+ return NO; |
+ |
+ web::NavigationItem* visibleItem = [self navigationManager]->GetVisibleItem(); |
Eugene But (OOO till 7-30)
2017/02/23 18:00:12
ditto
liaoyuke
2017/02/23 18:37:11
Done.
|
+ return visibleItem && visibleItem->IsOverridingUserAgent(); |
} |
- (void)enableDesktopUserAgent { |
- DCHECK_EQ(self.useDesktopUserAgent, NO); |
+ DCHECK_EQ(self.usesDesktopUserAgent, NO); |
DCHECK([self navigationManager]); |
[self navigationManager]->OverrideDesktopUserAgentForNextPendingItem(); |
} |