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

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

Issue 2144933002: Fix the T-Rex easter egg on iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 f99068e3b769094b6772f6fda3d274a8749cd0f3..61ca6a63679f7dc0c24d902b6fdf4508ebffe983 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -33,26 +33,27 @@ void VerifyWKWebViewCreationPreConditions(
WKWebViewConfiguration* configuration,
BrowserState* browser_state,
BOOL use_desktop_user_agent) {
- WKWebView* web_view = CreateWKWebView(frame, configuration, browser_state);
- web_view.customUserAgent = base::SysUTF8ToNSString(
- web::GetWebClient()->GetUserAgent(use_desktop_user_agent));
- return web_view;
-}
-
-WKWebView* CreateWKWebView(CGRect frame,
- WKWebViewConfiguration* configuration,
- BrowserState* browser_state) {
VerifyWKWebViewCreationPreConditions(browser_state, configuration);
GetWebClient()->PreWebViewCreation();
- WKWebView* result =
+ WKWebView* web_view =
[[WKWebView alloc] initWithFrame:frame configuration:configuration];
// By default the web view uses a very sluggish scroll speed. Set it to a more
// reasonable value.
- result.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
+ web_view.scrollView.decelerationRate = UIScrollViewDecelerationRateNormal;
- return result;
+ // Set the user agent.
+ web_view.customUserAgent = base::SysUTF8ToNSString(
+ web::GetWebClient()->GetUserAgent(use_desktop_user_agent));
+
+ return web_view;
+}
+
+WKWebView* CreateWKWebView(CGRect frame,
+ WKWebViewConfiguration* configuration,
+ BrowserState* browser_state) {
+ return CreateWKWebView(frame, configuration, browser_state, NO);
Eugene But (OOO till 7-30) 2016/07/13 05:28:57 Optional NIT: /* use_desktop_user_agent */ or crea
kkhorimoto 2016/07/13 17:54:53 Done.
}
} // namespace web
« components/neterror/resources/offline.js ('K') | « components/neterror/resources/offline.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698