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

[ios] Log Default Browser Promo interaction for all modal dismisses

Bug: 1130064
Change-Id: Iedd92a96e41306e88af0d9531825adc96f27aa17
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2419532
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Auto-Submit: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809166}
parent 8b5a33bd
......@@ -462,6 +462,9 @@
[self.infobarModalOverlayContainerCoordinator stop];
self.infobarModalOverlayContainerCoordinator = nil;
[self.defaultBrowserPromoCoordinator stop];
self.defaultBrowserPromoCoordinator = nil;
}
#pragma mark - ActivityServiceCommands
......@@ -568,6 +571,7 @@
- (void)hidePromo {
[self.defaultBrowserPromoCoordinator stop];
self.defaultBrowserPromoCoordinator = nil;
}
#pragma mark - FindInPageCommands
......
......@@ -29,7 +29,9 @@ enum IOSDefaultBrowserFullscreenPromoAction {
} // namespace
@interface DefaultBrowserPromoCoordinator () <ConfirmationAlertActionHandler>
@interface DefaultBrowserPromoCoordinator () <
ConfirmationAlertActionHandler,
UIAdaptivePresentationControllerDelegate>
// The fullscreen confirmation modal promo view controller this coordiantor
// manages.
......@@ -52,6 +54,7 @@ enum IOSDefaultBrowserFullscreenPromoAction {
self.defaultBrowerPromoViewController.actionHandler = self;
self.defaultBrowerPromoViewController.modalPresentationStyle =
UIModalPresentationFormSheet;
self.defaultBrowerPromoViewController.presentationController.delegate = self;
[self.baseViewController
presentViewController:self.defaultBrowerPromoViewController
animated:YES
......@@ -59,6 +62,9 @@ enum IOSDefaultBrowserFullscreenPromoAction {
}
- (void)stop {
// Ensure that presentationControllerDidDismiss: is not called in response to
// a stop.
self.defaultBrowerPromoViewController.presentationController.delegate = nil;
[self.defaultBrowerPromoViewController.presentingViewController
dismissViewControllerAnimated:YES
completion:nil];
......@@ -66,6 +72,14 @@ enum IOSDefaultBrowserFullscreenPromoAction {
[super stop];
}
#pragma mark - UIAdaptivePresentationControllerDelegate
- (void)presentationControllerDidDismiss:
(UIPresentationController*)presentationController {
// This ensures that a modal swipe dismss will also be logged.
LogUserInteractionWithFullscreenPromo();
}
#pragma mark - ConfirmationAlertActionHandler
- (void)confirmationAlertDismissAction {
......
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