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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2705293014: Created web::UserAgentType. (Closed)
Patch Set: rebase + compile fix 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
« no previous file with comments | « ios/web/shell/shell_web_client.mm ('k') | ios/web/web_state/web_view_internal_creation_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 5d3d172b208b6c4a1e921e4a8ed74959b443cbcc..e162b1a18f0827149c95b2c8217c80a24fbd7e26 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -2332,7 +2332,7 @@ - (BOOL)shouldClosePageOnNativeApplicationLoad {
- (BOOL)usesDesktopUserAgent {
web::NavigationItem* item = [self currentNavItem];
- return item && item->IsOverridingUserAgent();
+ return item && item->GetUserAgentType() == web::UserAgentType::DESKTOP;
}
- (web::MojoFacade*)mojoFacade {
@@ -2382,12 +2382,11 @@ - (void)updateDesktopUserAgentForEntry:(CRWSessionEntry*)entry
fromEntry:(CRWSessionEntry*)fromEntry {
web::NavigationItemImpl* item = entry.navigationItemImpl;
web::NavigationItemImpl* fromItem = fromEntry.navigationItemImpl;
- if (!item || !fromItem)
+ web::UserAgentType itemUserAgentType = item->GetUserAgentType();
+ if (!item || !fromItem || itemUserAgentType == web::UserAgentType::NONE)
return;
- bool useDesktopUserAgent = item->IsOverridingUserAgent();
- if (useDesktopUserAgent != fromItem->IsOverridingUserAgent()) {
+ if (itemUserAgentType != fromItem->GetUserAgentType())
[self requirePageReconstruction];
- }
}
#pragma mark -
« no previous file with comments | « ios/web/shell/shell_web_client.mm ('k') | ios/web/web_state/web_view_internal_creation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698