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

Unified Diff: ios/web/web_state/web_view_internal_creation_util.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
Index: ios/web/web_state/web_view_internal_creation_util.mm
diff --git a/ios/web/web_state/web_view_internal_creation_util.mm b/ios/web/web_state/web_view_internal_creation_util.mm
index 59ff848827db4e88498c12062a89ec4627d06a95..c13b8b77713499d7c5a241e873d4340c49f51173 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -45,8 +45,10 @@ void VerifyWKWebViewCreationPreConditions(
[[WKWebView alloc] initWithFrame:frame configuration:configuration];
// Set the user agent.
+ UserAgentType user_agent_type =
+ use_desktop_user_agent ? UserAgentType::DESKTOP : UserAgentType::MOBILE;
web_view.customUserAgent = base::SysUTF8ToNSString(
- web::GetWebClient()->GetUserAgent(use_desktop_user_agent));
+ web::GetWebClient()->GetUserAgent(user_agent_type));
// By default the web view uses a very sluggish scroll speed. Set it to a more
// reasonable value.
« no previous file with comments | « ios/web/web_state/ui/crw_web_controller.mm ('k') | ios/web_view/internal/web_view_url_request_context_getter.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698