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

Unified Diff: ios/web/web_state/web_view_internal_creation_util.mm

Issue 2811073005: Replace requirePageReconstruction with setCustomUserAgent (Closed)
Patch Set: Remove unncessary if condition and add comments Created 3 years, 8 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/web_state/web_view_internal_creation_util.h ('k') | ios/web/web_view_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/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 c13b8b77713499d7c5a241e873d4340c49f51173..7c9fc45961de4c0b3455716524f2ec3945f34790 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -36,7 +36,7 @@ void VerifyWKWebViewCreationPreConditions(
WKWebView* BuildWKWebView(CGRect frame,
WKWebViewConfiguration* configuration,
BrowserState* browser_state,
- BOOL use_desktop_user_agent,
+ UserAgentType user_agent_type,
id<CRWContextMenuDelegate> context_menu_delegate) {
VerifyWKWebViewCreationPreConditions(browser_state, configuration);
@@ -44,9 +44,6 @@ void VerifyWKWebViewCreationPreConditions(
WKWebView* web_view =
[[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(user_agent_type));
@@ -77,17 +74,16 @@ void VerifyWKWebViewCreationPreConditions(
WKWebView* BuildWKWebView(CGRect frame,
WKWebViewConfiguration* configuration,
BrowserState* browser_state,
- BOOL use_desktop_user_agent) {
- return BuildWKWebView(frame, configuration, browser_state,
- use_desktop_user_agent, nil);
+ UserAgentType user_agent_type) {
+ return BuildWKWebView(frame, configuration, browser_state, user_agent_type,
+ nil);
}
WKWebView* BuildWKWebView(CGRect frame,
WKWebViewConfiguration* configuration,
BrowserState* browser_state) {
- BOOL use_desktop_user_agent = NO;
return BuildWKWebView(frame, configuration, browser_state,
- use_desktop_user_agent);
+ UserAgentType::MOBILE);
}
} // namespace web
« no previous file with comments | « ios/web/web_state/web_view_internal_creation_util.h ('k') | ios/web/web_view_creation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698