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

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

Issue 1682273002: Use consistent background color for WKWebViews. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 cbf01d6474f40f6926eea40971cc5fdf629c8eb4..2ac42ed59d8e0c0fde32f2daa4784b95bd783205 100644
--- a/ios/web/web_state/web_view_internal_creation_util.mm
+++ b/ios/web/web_state/web_view_internal_creation_util.mm
@@ -41,6 +41,9 @@ web::WeakNSObjectCounter& GetActiveWKWebViewCounter() {
return active_wk_web_view_counter;
}
+// The brightness of the web views' background colors.
+const CGFloat kWebViewBackgroundColorBrightness = 0.2;
+
// Decides if web views can be created.
bool gAllowWebViewCreation = NO;
@@ -184,6 +187,8 @@ WKWebView* CreateWKWebView(CGRect frame,
#endif
WKWebView* result =
[[WKWebView alloc] initWithFrame:frame configuration:configuration];
+ result.backgroundColor =
+ [UIColor colorWithWhite:kWebViewBackgroundColorBrightness alpha:1.0];
#if !defined(NDEBUG)
gAllowWebViewCreation = previous_allow_web_view_creation_value;
#endif

Powered by Google App Engine
This is Rietveld 408576698