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 @@ ...@@ -462,6 +462,9 @@
[self.infobarModalOverlayContainerCoordinator stop]; [self.infobarModalOverlayContainerCoordinator stop];
self.infobarModalOverlayContainerCoordinator = nil; self.infobarModalOverlayContainerCoordinator = nil;
[self.defaultBrowserPromoCoordinator stop];
self.defaultBrowserPromoCoordinator = nil;
} }
#pragma mark - ActivityServiceCommands #pragma mark - ActivityServiceCommands
...@@ -568,6 +571,7 @@ ...@@ -568,6 +571,7 @@
- (void)hidePromo { - (void)hidePromo {
[self.defaultBrowserPromoCoordinator stop]; [self.defaultBrowserPromoCoordinator stop];
self.defaultBrowserPromoCoordinator = nil;
} }
#pragma mark - FindInPageCommands #pragma mark - FindInPageCommands
......
...@@ -29,7 +29,9 @@ enum IOSDefaultBrowserFullscreenPromoAction { ...@@ -29,7 +29,9 @@ enum IOSDefaultBrowserFullscreenPromoAction {
} // namespace } // namespace
@interface DefaultBrowserPromoCoordinator () <ConfirmationAlertActionHandler> @interface DefaultBrowserPromoCoordinator () <
ConfirmationAlertActionHandler,
UIAdaptivePresentationControllerDelegate>
// The fullscreen confirmation modal promo view controller this coordiantor // The fullscreen confirmation modal promo view controller this coordiantor
// manages. // manages.
...@@ -52,6 +54,7 @@ enum IOSDefaultBrowserFullscreenPromoAction { ...@@ -52,6 +54,7 @@ enum IOSDefaultBrowserFullscreenPromoAction {
self.defaultBrowerPromoViewController.actionHandler = self; self.defaultBrowerPromoViewController.actionHandler = self;
self.defaultBrowerPromoViewController.modalPresentationStyle = self.defaultBrowerPromoViewController.modalPresentationStyle =
UIModalPresentationFormSheet; UIModalPresentationFormSheet;
self.defaultBrowerPromoViewController.presentationController.delegate = self;
[self.baseViewController [self.baseViewController
presentViewController:self.defaultBrowerPromoViewController presentViewController:self.defaultBrowerPromoViewController
animated:YES animated:YES
...@@ -59,6 +62,9 @@ enum IOSDefaultBrowserFullscreenPromoAction { ...@@ -59,6 +62,9 @@ enum IOSDefaultBrowserFullscreenPromoAction {
} }
- (void)stop { - (void)stop {
// Ensure that presentationControllerDidDismiss: is not called in response to
// a stop.
self.defaultBrowerPromoViewController.presentationController.delegate = nil;
[self.defaultBrowerPromoViewController.presentingViewController [self.defaultBrowerPromoViewController.presentingViewController
dismissViewControllerAnimated:YES dismissViewControllerAnimated:YES
completion:nil]; completion:nil];
...@@ -66,6 +72,14 @@ enum IOSDefaultBrowserFullscreenPromoAction { ...@@ -66,6 +72,14 @@ enum IOSDefaultBrowserFullscreenPromoAction {
[super stop]; [super stop];
} }
#pragma mark - UIAdaptivePresentationControllerDelegate
- (void)presentationControllerDidDismiss:
(UIPresentationController*)presentationController {
// This ensures that a modal swipe dismss will also be logged.
LogUserInteractionWithFullscreenPromo();
}
#pragma mark - ConfirmationAlertActionHandler #pragma mark - ConfirmationAlertActionHandler
- (void)confirmationAlertDismissAction { - (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