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

Unified Diff: ios/web/web_state/ui/crw_web_controller_container_view.mm

Issue 1531593002: Adding CRWWebViewContentView as a subview when it is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller_container_view.mm
diff --git a/ios/web/web_state/ui/crw_web_controller_container_view.mm b/ios/web/web_state/ui/crw_web_controller_container_view.mm
index f0ec9976f9acdb32553c9d0906f50493d6b9b059..0fd7bceac74dfb4c5e8f1d428a8b44f08c4af554 100644
--- a/ios/web/web_state/ui/crw_web_controller_container_view.mm
+++ b/ios/web/web_state/ui/crw_web_controller_container_view.mm
@@ -160,6 +160,10 @@
if (![_webViewContentView isEqual:webViewContentView]) {
[_webViewContentView removeFromSuperview];
_webViewContentView.reset([webViewContentView retain]);
+ if (_webViewContentView) {
+ DCHECK(![_webViewContentView superview]);
+ [self addSubview:_webViewContentView];
+ }
}
}
@@ -215,12 +219,10 @@
- (void)layoutSubviews {
[super layoutSubviews];
- // webViewcontentView layout.
- if (self.webViewContentView) {
- if (!self.webViewContentView.superview)
- [self addSubview:self.webViewContentView];
- self.webViewContentView.frame = self.bounds;
- }
+ self.webViewContentView.frame = self.bounds;
+
+ // TODO(crbug.com/570114): Move adding of the following subviews to another
+ // place.
// nativeController layout.
if (self.nativeController) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698