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 @@ ...@@ -476,6 +476,8 @@
self.actionSheetCoordinator.alertStyle = UIAlertControllerStyleActionSheet; self.actionSheetCoordinator.alertStyle = UIAlertControllerStyleActionSheet;
__weak TabGridCoordinator* weakSelf = self;
[self.actionSheetCoordinator [self.actionSheetCoordinator
addItemWithTitle:base::SysUTF16ToNSString( addItemWithTitle:base::SysUTF16ToNSString(
l10n_util::GetPluralStringFUTF16( l10n_util::GetPluralStringFUTF16(
...@@ -485,6 +487,7 @@ ...@@ -485,6 +487,7 @@
base::RecordAction(base::UserMetricsAction( base::RecordAction(base::UserMetricsAction(
"MobileTabGridCloseAllTabsConfirmationConfirmed")); "MobileTabGridCloseAllTabsConfirmationConfirmed"));
[tabGridMediator closeAllItems]; [tabGridMediator closeAllItems];
[weakSelf.baseViewController closeAllTabsConfirmationClosed];
} }
style:UIAlertActionStyleDestructive]; style:UIAlertActionStyleDestructive];
[self.actionSheetCoordinator [self.actionSheetCoordinator
...@@ -492,6 +495,7 @@ ...@@ -492,6 +495,7 @@
action:^{ action:^{
base::RecordAction(base::UserMetricsAction( base::RecordAction(base::UserMetricsAction(
"MobileTabGridCloseAllTabsConfirmationCanceled")); "MobileTabGridCloseAllTabsConfirmationCanceled"));
[weakSelf.baseViewController closeAllTabsConfirmationClosed];
} }
style:UIAlertActionStyleCancel]; style:UIAlertActionStyleCancel];
[self.actionSheetCoordinator start]; [self.actionSheetCoordinator start];
......
...@@ -80,6 +80,10 @@ ...@@ -80,6 +80,10 @@
- (void)contentDidAppear; - (void)contentDidAppear;
- (void)contentWillDisappearAnimated:(BOOL)animated; - (void)contentWillDisappearAnimated:(BOOL)animated;
// Notifies the ViewController that the Close All Tabs confirmation action sheet
// has been closed.
- (void)closeAllTabsConfirmationClosed;
@end @end
#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_VIEW_CONTROLLER_H_ #endif // IOS_CHROME_BROWSER_UI_TAB_GRID_TAB_GRID_VIEW_CONTROLLER_H_
...@@ -401,6 +401,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -401,6 +401,10 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
self.remoteTabsViewController.preventUpdates = YES; self.remoteTabsViewController.preventUpdates = YES;
} }
- (void)closeAllTabsConfirmationClosed {
self.topToolbar.pageControl.userInteractionEnabled = YES;
}
#pragma mark - Public Properties #pragma mark - Public Properties
- (id<GridConsumer>)regularTabsConsumer { - (id<GridConsumer>)regularTabsConsumer {
...@@ -1329,7 +1333,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -1329,7 +1333,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
// toolbar in order to avoid alignment issues when changing the device // toolbar in order to avoid alignment issues when changing the device
// orientation to landscape in multi window mode. // orientation to landscape in multi window mode.
UIBarButtonItem* buttonAnchor = self.topToolbar.leadingButton; UIBarButtonItem* buttonAnchor = self.topToolbar.leadingButton;
self.topToolbar.pageControl.userInteractionEnabled = NO;
switch (self.currentPage) { switch (self.currentPage) {
case TabGridPageIncognitoTabs: case TabGridPageIncognitoTabs:
[self.incognitoTabsDelegate [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