Commit 61938138 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Chromium LUCI CQ

[iOS] Fix Fakebox width in screenshots

This CL ensures that the fakebox width is correct when the screenshot of
the NTP is taken. It was wrong as the width was first computed while the
collection view had a zero width. The width is now re-computed when the
NTP is added to its parent ViewController.

Fixed: 1165956
Change-Id: I63cf57584fe185280956779791973495092dfbb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2640440
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#846291}
parent ed633628
......@@ -340,6 +340,15 @@ NSString* const kContentSuggestionsMostVisitedAccessibilityIdentifierPrefix =
self.headerSynchronizer.showing = NO;
}
- (void)didMoveToParentViewController:(UIViewController*)parent {
[super didMoveToParentViewController:parent];
if (!parent)
return;
[self.headerSynchronizer
updateFakeOmniboxOnNewWidth:self.parentViewController.view.bounds.size
.width];
}
- (void)viewWillTransitionToSize:(CGSize)size
withTransitionCoordinator:
(id<UIViewControllerTransitionCoordinator>)coordinator {
......
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