Commit 6a4420c7 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Adding metrics in the Advanced settings sign-in

Adding user actions for the advanced setting view:
 + Signin_Signin_ConfirmAdvancedSyncSettings
The user taps on "Confirm".

 + Signin_Signin_CancelAdvancedSyncSettings
The user cancels the settings (by tapping on the cancel button and then
validate the alert dialog).

Bug: 937110
Change-Id: I4d3653571febd373b0a642e56dc35f5d1f369532
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1554675
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649613}
parent 8680bb35
......@@ -7,6 +7,7 @@
#import <UIKit/UIKit.h>
#include "base/logging.h"
#include "base/metrics/user_metrics.h"
#include "components/signin/core/browser/signin_metrics.h"
#include "components/strings/grit/components_strings.h"
#import "ios/chrome/browser/signin/authentication_service.h"
......@@ -125,6 +126,8 @@ using l10n_util::GetNSString;
// Called by the cancel button from the navigation controller. Presents a
// UIAlert to ask the user if wants to cancel the sign-in.
- (void)navigationCancelButtonAction {
base::RecordAction(
base::UserMetricsAction("Signin_Signin_CancelAdvancedSyncSettings"));
self.cancelConfirmationAlertCoordinator = [[AlertCoordinator alloc]
initWithBaseViewController:self.advancedSigninSettingsNavigationController
title:
......@@ -157,6 +160,8 @@ using l10n_util::GetNSString;
// sync preferences chosen by the user, starts the sync, close the completion
// callback and closes the advanced sign-in settings.
- (void)navigationConfirmButtonAction {
base::RecordAction(
base::UserMetricsAction("Signin_Signin_ConfirmAdvancedSyncSettings"));
DCHECK_EQ(self.advancedSigninSettingsNavigationController,
self.baseViewController.presentedViewController);
void (^completion)(void) = ^{
......@@ -172,7 +177,12 @@ using l10n_util::GetNSString;
[self.cancelConfirmationAlertCoordinator stop];
self.cancelConfirmationAlertCoordinator = nil;
if (cancelSync) {
base::RecordAction(base::UserMetricsAction(
"Signin_Signin_ConfirmCancelAdvancedSyncSettings"));
[self cancelWithDismiss:YES];
} else {
base::RecordAction(base::UserMetricsAction(
"Signin_Signin_CancelCancelAdvancedSyncSettings"));
}
}
......
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