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

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

Issue 2711683002: (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Remove IsUsingDesktopUserAgent in NavigationManagerImpl 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/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 bfcc3f987101de631b9de34ac04db4e97a7df7ee..47a576ceeee7b59b82084a502dcb54a9e826abbd 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -458,9 +458,6 @@ @interface CRWWebController ()<CRWContextMenuDelegate,
// Returns YES if the user interacted with the page recently.
@property(nonatomic, readonly) BOOL userClickedRecently;
-// Returns whether the desktop user agent should be used when setting the user
-// agent.
-@property(nonatomic, readonly) BOOL useDesktopUserAgent;
// Facade for Mojo API.
@property(nonatomic, readonly) web::MojoFacade* mojoFacade;
@@ -2339,11 +2336,6 @@ - (BOOL)shouldClosePageOnNativeApplicationLoad {
return rendererInitiatedWithoutInteraction || noNavigationItems;
}
-- (BOOL)useDesktopUserAgent {
- web::NavigationItem* item = [self currentNavItem];
- return item && item->IsOverridingUserAgent();
-}
-
- (web::MojoFacade*)mojoFacade {
if (!_mojoFacade) {
service_manager::mojom::InterfaceProvider* interfaceProvider =
@@ -4210,11 +4202,17 @@ - (void)ensureWebViewCreatedWithConfiguration:(WKWebViewConfiguration*)config {
}
- (WKWebView*)webViewWithConfiguration:(WKWebViewConfiguration*)config {
+ web::NavigationItem* visibleItem =
Eugene But (OOO till 7-30) 2017/02/23 00:54:24 Is there a reason for removing |useDesktopUserAgen
liaoyuke 2017/02/23 01:10:14 Done.
kkhorimoto 2017/02/23 01:16:25 I suggested removing the old property because of t
+ self.navigationManagerImpl ? self.navigationManagerImpl->GetVisibleItem()
+ : nil;
+ BOOL isUsingDesktopUseragent =
Eugene But (OOO till 7-30) 2017/02/23 00:54:24 shouldUseDesktopUserAgent Agent capitalized, |is|
liaoyuke 2017/02/23 01:10:14 Acknowledged.
+ visibleItem && visibleItem->IsOverridingUserAgent();
+
// Do not attach the context menu controller immediately as the JavaScript
// delegate must be specified.
return web::BuildWKWebView(CGRectZero, config,
self.webStateImpl->GetBrowserState(),
- [self useDesktopUserAgent]);
+ isUsingDesktopUseragent);
}
- (void)setWebView:(WKWebView*)webView {
« ios/chrome/browser/tabs/tab.h ('K') | « ios/web/navigation/crw_session_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698