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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2710593010: Reland of (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Update comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index e8e4d245ae79eb7ce67ed26d4ce2e50fc2850ba7..f669f1bfbc80ababda2f0e9c34eae5e1e1b9fb05 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -1550,13 +1550,16 @@ - (void)openAppStore:(NSString*)appId {
[storeKitLauncher_ openAppStore:appId];
}
-- (BOOL)useDesktopUserAgent {
- web::NavigationItem* currentItem = self.currentNavigationItem;
- return currentItem && currentItem->IsOverridingUserAgent();
+- (BOOL)usesDesktopUserAgent {
+ if (!self.navigationManager)
+ return NO;
+
+ web::NavigationItem* visibleItem = self.navigationManager->GetVisibleItem();
+ return visibleItem && visibleItem->IsOverridingUserAgent();
}
- (void)enableDesktopUserAgent {
- DCHECK_EQ(self.useDesktopUserAgent, NO);
+ DCHECK_EQ(self.usesDesktopUserAgent, NO);
DCHECK([self navigationManager]);
[self navigationManager]->OverrideDesktopUserAgentForNextPendingItem();
}

Powered by Google App Engine
This is Rietveld 408576698