Commit 6b08da93 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Dismiss Clear Browsing Data before Dismissing History Navigation Controller

If Clear Browsing Data is presented when History attempts to dismiss itself, nothing will happen. Need to dismiss Clear Browsing Data First.

Video: https://drive.google.com/open?id=1KUKsgv8OSQc_1301ff2XMgK2_hi6dd1-

Bug: 867329

Change-Id: I1cd5f242ef410267ed5d4ab0e006884a3288eafe
Reviewed-on: https://chromium-review.googlesource.com/1150620
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578544}
parent c643d9b7
......@@ -31,6 +31,10 @@
// Delegate used to make the Tab UI visible.
@property(nonatomic, weak) id<HistoryPresentationDelegate> presentationDelegate;
// Stops this Coordinator then calls |completionHandler|. |completionHandler|
// always will be run.
- (void)stopWithCompletion:(ProceduralBlock)completionHandler;
@end
#endif // IOS_CHROME_BROWSER_UI_HISTORY_HISTORY_CLEAR_BROWSING_DATA_COORDINATOR_H_
......@@ -63,6 +63,17 @@
completion:nil];
}
- (void)stopWithCompletion:(ProceduralBlock)completionHandler {
if (self.historyClearBrowsingDataNavigationController) {
[self.historyClearBrowsingDataNavigationController
dismissViewControllerAnimated:YES
completion:completionHandler];
self.historyClearBrowsingDataNavigationController = nil;
} else if (completionHandler) {
completionHandler();
}
}
#pragma mark - ClearBrowsingDataLocalCommands
- (void)openURL:(const GURL&)URL {
......
......@@ -103,10 +103,19 @@
// This method should always execute the |completionHandler|.
- (void)stopWithCompletion:(ProceduralBlock)completionHandler {
if (self.historyNavigationController) {
[self.historyNavigationController
dismissViewControllerAnimated:YES
completion:completionHandler];
self.historyNavigationController = nil;
void (^dismissHistoryNavigation)(void) = ^void() {
[self.historyNavigationController
dismissViewControllerAnimated:YES
completion:completionHandler];
self.historyNavigationController = nil;
};
if (self.historyClearBrowsingDataCoordinator) {
[self.historyClearBrowsingDataCoordinator
stopWithCompletion:dismissHistoryNavigation];
self.historyClearBrowsingDataCoordinator = nil;
} else {
dismissHistoryNavigation();
}
} else if (completionHandler) {
completionHandler();
}
......
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