[iOS] Reload NTP's all data with a delay

This CL modifies the method in the NTP collection items handler to
reload all the data by adding a delay before it is executed.
The delay is necessary because UICollectionView's -reloadData method
isn't working if another operation modifying the collection is taking
place.
When the user sign in, we got a callback to modify a section before
reloading all the data, preventing the data from being completly
reloaded. This creates a stale state where the items for the collection
are updated but the cells aren't configured with those items.
It can create an issue where we are presenting stale data to the user
and also the delegate of the show/hide button is actually dealloc'ed
so tapping the button does nothing.

Bug: 945726
Change-Id: I993218c3af8422c2fa81a844efbd6b93b6877bcf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541223
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#650283}
1 file changed