Chromium Code Reviews| 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 { |