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

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: fixed indent 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
« no previous file with comments | « components/neterror/resources/offline.js ('k') | no next file » | 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 691d0863479cd9c82295418651ca010393ee3b0c..4a96aaeb365a154d08b50f7ddc4e8c8ea3ad8938 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -33,32 +33,35 @@ 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];
+ // Set the user agent.
+ web_view.customUserAgent = base::SysUTF8ToNSString(
+ web::GetWebClient()->GetUserAgent(use_desktop_user_agent));
+
// 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;
// Starting in iOS10, |allowsLinkPreview| defaults to YES. This should be
// disabled since the default implementation will open the link in Safari.
// TODO(crbug.com/622746): Remove once web// link preview implementation is
// created.
- result.allowsLinkPreview = NO;
+ web_view.allowsLinkPreview = NO;
+
+ return web_view;
+}
- return result;
+WKWebView* CreateWKWebView(CGRect frame,
+ WKWebViewConfiguration* configuration,
+ BrowserState* browser_state) {
+ BOOL use_desktop_user_agent = NO;
+ return CreateWKWebView(frame, configuration, browser_state,
+ use_desktop_user_agent);
}
} // namespace web
« no previous file with comments | « components/neterror/resources/offline.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698