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 2711683002: (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Remove getter for usesDesktopUserAgent property 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 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();
}

Powered by Google App Engine
This is Rietveld 408576698