Commit c41f65da authored by Ewann's avatar Ewann Committed by Commit Bot

[iOS] Fixes 'Close All' button initialization

This CL sets the leadingButton title during its initialization which
allows the confirmation actionSheet to be correctly anchored.
Previously the actionSheet was anchored before the title was configured,
causing misalignment.


Bug: 1140982
Change-Id: Ie35be2d119585b9512dff5cd9ed347ad02934254
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2517589
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824374}
parent ab165571
......@@ -833,6 +833,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
topToolbar.translatesAutoresizingMaskIntoConstraints = NO;
[self.view addSubview:topToolbar];
// Sets the leadingButton title during initialization allows the actionSheet
// to be correctly anchored. See: crbug.com/1140982.
topToolbar.leadingButton.title =
l10n_util::GetNSString(IDS_IOS_TAB_GRID_CLOSE_ALL_BUTTON);
topToolbar.leadingButton.target = self;
if (base::FeatureList::IsEnabled(kEnableCloseAllTabsConfirmation)) {
topToolbar.leadingButton.action =
......
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