Commit d565f863 authored by Kurt Horimoto's avatar Kurt Horimoto Committed by Commit Bot

[iOS] Fix BrowserContainerViewController's |-displayContentView|.

This function should be a no-op if called with the currently-displayed
content view.

Bug: 826093
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I5283f1723d4f2240c017e4561644d134d989869d
Reviewed-on: https://chromium-review.googlesource.com/1015979Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552391}
parent bd410037
......@@ -32,21 +32,8 @@
}
- (void)displayContentView:(UIView*)contentView {
if (_contentView == contentView) {
// When voice search is launched from the NTP, the voice search button
// NamedGuide is constrained to a subview of |_contentView|. If this
// occurs, removing |_contentView| from the hierarchy below will deactivate
// the constraints. The check against the voice search button guide is a
// temporary workaround in order to minimize unintended side effects from
// this change; this function should be a no-op when |_contentView| ==
// |contentView|, regardless of the NamedGuide constraints.
// TODO(crbug.com/826093): Remove NamedGuide check and simply early return.
NamedGuide* voiceSearchGuide =
[NamedGuide guideWithName:kVoiceSearchButtonGuide view:self.view];
UIView* voiceSearchButton = voiceSearchGuide.constrainedView;
if ([voiceSearchButton isDescendantOfView:_contentView])
return;
}
if (_contentView == contentView)
return;
DCHECK(![_contentView superview] || [_contentView superview] == self.view);
[_contentView removeFromSuperview];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment