Commit 557e8c8d authored by Huanzhong Huang's avatar Huanzhong Huang Committed by Commit Bot

[iOS] Fix Clumsy CBD Interface Loading

The new Clear Browsing Data interface (behind the
new-clear-browsing-data-ui flag) currently loads its cells rather
clumsily: multiple cells changing their size upon loading. This is due
to counter callbacks filling in data counting results.

This change fixes this issue to a great extent through including a
placeholder text in each cell upon creation; a cell no longer needs to grow
, as long as the data counting result (that comes in later) requires no
more than one line to show.

Bug: 952379
Change-Id: I503d2bf8e052b90da2ace334d5df4c49ef8b09b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1583717
Commit-Queue: Huanzhong Huang <huanzhong@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654818}
parent 457e0a28
......@@ -497,6 +497,9 @@ static NSDictionary* _imageNamesByItemTypes = @{
tableViewClearDataItem.detailText =
l10n_util::GetNSString(IDS_DEL_COOKIES_COUNTER);
} else {
// Having a placeholder |detailText| helps reduce the observable
// row-height changes induced by the counter callbacks.
tableViewClearDataItem.detailText = @"\u00A0";
__weak ClearBrowsingDataManager* weakSelf = self;
__weak TableViewClearBrowsingDataItem* weakTableClearDataItem =
tableViewClearDataItem;
......
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