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

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

Issue 2711683002: (Set)IsOverridingUserAgent should be called on VisibleItem (Closed)
Patch Set: Rename function names 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 9be54a339178bdd4e335334a41159a6f5b187d8e..dddf7a5c0a26f7cf16ec45dbbc3725293627161f 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;
@@ -2331,11 +2328,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 =
@@ -4204,9 +4196,9 @@ - (void)ensureWebViewCreatedWithConfiguration:(WKWebViewConfiguration*)config {
- (WKWebView*)webViewWithConfiguration:(WKWebViewConfiguration*)config {
// 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]);
+ return web::BuildWKWebView(
+ CGRectZero, config, self.webStateImpl->GetBrowserState(),
+ self.navigationManagerImpl->IsUsingDesktopUserAgent());
Eugene But (OOO till 7-30) 2017/02/22 21:57:42 Is it guaranteed that |self.navigationManagerImpl|
liaoyuke 2017/02/22 23:48:31 Good catch!
}
- (void)setWebView:(WKWebView*)webView {

Powered by Google App Engine
This is Rietveld 408576698