Commit 30d05668 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS] Adding AfterAdvancedOptIn.SyncDataTypesOff metrics

RecordSyncSetupDataTypesHistrogam() is now called by
AdvancedSigninSettingsCoordinator when the signed in is confirmed.

Bug: 961691
Change-Id: I9f01c37f661e796d44ffa0905956ffb922b55a2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1605913Reviewed-by: default avatarThomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#658726}
parent ff10b5a4
...@@ -10,8 +10,12 @@ ...@@ -10,8 +10,12 @@
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "components/signin/core/browser/signin_metrics.h" #include "components/signin/core/browser/signin_metrics.h"
#include "components/strings/grit/components_strings.h" #include "components/strings/grit/components_strings.h"
#include "components/sync/driver/sync_service.h"
#include "components/unified_consent/unified_consent_metrics.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/signin/authentication_service.h" #import "ios/chrome/browser/signin/authentication_service.h"
#import "ios/chrome/browser/signin/authentication_service_factory.h" #import "ios/chrome/browser/signin/authentication_service_factory.h"
#include "ios/chrome/browser/sync/profile_sync_service_factory.h"
#include "ios/chrome/browser/sync/sync_setup_service.h" #include "ios/chrome/browser/sync/sync_setup_service.h"
#include "ios/chrome/browser/sync/sync_setup_service_factory.h" #include "ios/chrome/browser/sync/sync_setup_service_factory.h"
#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h" #import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
...@@ -102,9 +106,13 @@ typedef NS_ENUM(NSInteger, AdvancedSigninSettingsCoordinatorResult) { ...@@ -102,9 +106,13 @@ typedef NS_ENUM(NSInteger, AdvancedSigninSettingsCoordinatorResult) {
SyncSetupService* syncSetupService = SyncSetupService* syncSetupService =
SyncSetupServiceFactory::GetForBrowserState(self.browserState); SyncSetupServiceFactory::GetForBrowserState(self.browserState);
switch (result) { switch (result) {
case AdvancedSyncSettingsCoordinatorResultConfirm: case AdvancedSyncSettingsCoordinatorResultConfirm: {
base::RecordAction( base::RecordAction(
base::UserMetricsAction("Signin_Signin_ConfirmAdvancedSyncSettings")); base::UserMetricsAction("Signin_Signin_ConfirmAdvancedSyncSettings"));
syncer::SyncService* syncService =
ProfileSyncServiceFactory::GetForBrowserState(self.browserState);
unified_consent::metrics::RecordSyncSetupDataTypesHistrogam(
syncService->GetUserSettings(), self.browserState->GetPrefs());
if (syncSetupService->IsSyncEnabled()) { if (syncSetupService->IsSyncEnabled()) {
// FirstSetupComplete flag should be only turned on when the user agrees // FirstSetupComplete flag should be only turned on when the user agrees
// to start Sync. // to start Sync.
...@@ -112,6 +120,7 @@ typedef NS_ENUM(NSInteger, AdvancedSigninSettingsCoordinatorResult) { ...@@ -112,6 +120,7 @@ typedef NS_ENUM(NSInteger, AdvancedSigninSettingsCoordinatorResult) {
syncSetupService->SetFirstSetupComplete(); syncSetupService->SetFirstSetupComplete();
} }
break; break;
}
case AdvancedSigninSettingsCoordinatorResultCancel: case AdvancedSigninSettingsCoordinatorResultCancel:
base::RecordAction(base::UserMetricsAction( base::RecordAction(base::UserMetricsAction(
"Signin_Signin_ConfirmCancelAdvancedSyncSettings")); "Signin_Signin_ConfirmCancelAdvancedSyncSettings"));
......
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