Commit 9978b8f7 authored by Sébastien Séguin-Gagnon's avatar Sébastien Séguin-Gagnon Committed by Commit Bot

[Empties] Reload content before calculating bookmark promo offset.

In some cases the model and table were not in sync, which caused a
crash when trying to get the visibleCells of the table.

The reload should not be too expensive since we only call it when
we're on the root bookmark page.

Bug: 1116408
Change-Id: I41e3f1c6d09ca5b92f2bbb0494d426e04f2db539
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2370605Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: sebsg <sebsg@chromium.org>
Auto-Submit: sebsg <sebsg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801008}
parent 6bb7559f
......@@ -1472,6 +1472,12 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
// If the Signin promo is visible on the root view, we have to shift the
// empty TableView background to make it fully visible on all devices.
if ([self isDisplayingBookmarkRoot]) {
// Reload the data to ensure consistency between the model and the table
// (an example scenario can be found at crbug.com/1116408). Reloading the
// data should only be done for the root bookmark folder since it can be
// very expensive in other folders.
[self.sharedState.tableView reloadData];
self.navigationItem.largeTitleDisplayMode =
UINavigationItemLargeTitleDisplayModeNever;
if (self.sharedState.promoVisible &&
......
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