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

[iOS] Disables top toolbar when Close All Tabs Confirmation is displayed

This CL disables the top toolbar of the tab grid  the 'Close All Tabs'
Confirmation action sheet is displayed.

Bug: 1140518
Change-Id: I6e6d8f5103554e79b40f7ab1cdb8e962e43822a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2502478
Commit-Queue: Ewann Pellé <ewannpv@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#822091}
parent 6fd052ff
......@@ -476,6 +476,8 @@
self.actionSheetCoordinator.alertStyle = UIAlertControllerStyleActionSheet;
__weak TabGridCoordinator* weakSelf = self;
[self.actionSheetCoordinator
addItemWithTitle:base::SysUTF16ToNSString(
l10n_util::GetPluralStringFUTF16(
......@@ -485,6 +487,7 @@
base::RecordAction(base::UserMetricsAction(
"MobileTabGridCloseAllTabsConfirmationConfirmed"));
[tabGridMediator closeAllItems];
[weakSelf.baseViewController closeAllTabsConfirmationClosed];
}
style:UIAlertActionStyleDestructive];
[self.actionSheetCoordinator
......@@ -492,6 +495,7 @@
action:^{
base::RecordAction(base::UserMetricsAction(
"MobileTabGridCloseAllTabsConfirmationCanceled"));
[weakSelf.baseViewController closeAllTabsConfirmationClosed];
}
style:UIAlertActionStyleCancel];
[self.actionSheetCoordinator start];
......
......@@ -80,6 +80,10 @@
- (void)contentDidAppear;
- (void)contentWillDisappearAnimated:(BOOL)animated;
// Notifies the ViewController that the Close All Tabs confirmation action sheet
// has been closed.
- (void)closeAllTabsConfirmationClosed;
@end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_VIEW_CONTROLLER_H_
......@@ -401,6 +401,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
self.remoteTabsViewController.preventUpdates = YES;
}
- (void)closeAllTabsConfirmationClosed {
self.topToolbar.pageControl.userInteractionEnabled = YES;
}
#pragma mark - Public Properties
- (id<GridConsumer>)regularTabsConsumer {
......@@ -1329,7 +1333,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// toolbar in order to avoid alignment issues when changing the device
// orientation to landscape in multi window mode.
UIBarButtonItem* buttonAnchor = self.topToolbar.leadingButton;
self.topToolbar.pageControl.userInteractionEnabled = NO;
switch (self.currentPage) {
case TabGridPageIncognitoTabs:
[self.incognitoTabsDelegate
......
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