Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2257)

Unified Diff: chrome/browser/permissions/permission_uma_util.cc

Issue 2220323002: Permission Action Reporting: Do not report for Custom Passphrase users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/permissions/permission_uma_util.cc
diff --git a/chrome/browser/permissions/permission_uma_util.cc b/chrome/browser/permissions/permission_uma_util.cc
index 3ea75c74115282983e75d3d5cce4576ac60d3d1a..f1450e3d0a453be423a374b569c996d97df8e0d9 100644
--- a/chrome/browser/permissions/permission_uma_util.cc
+++ b/chrome/browser/permissions/permission_uma_util.cc
@@ -560,20 +560,26 @@ bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) {
ProfileSyncService* profile_sync_service =
ProfileSyncServiceFactory::GetForProfile(profile);
- // Do not report if profile can't get a profile sync service due to disable
- // sync flag.
- if (!profile_sync_service)
+
+ // Do not report if profile can't get a profile sync service or sync cannot
+ // start.
+ if (!(profile_sync_service && profile_sync_service->CanSyncStart()))
return false;
- if (!profile_sync_service->CanSyncStart())
+ // Do not report for users with a Custom passphrase set. We need to wait for
+ // Sync to be active in order to check the passphrase, so we don't report if
+ // Sync is not active yet.
+ if (!profile_sync_service->IsSyncActive() ||
+ profile_sync_service->IsUsingSecondaryPassphrase()) {
return false;
+ }
syncer::ModelTypeSet preferred_data_types =
profile_sync_service->GetPreferredDataTypes();
- if (!preferred_data_types.Has(syncer::PROXY_TABS))
- return false;
- if (!preferred_data_types.Has(syncer::PRIORITY_PREFERENCES))
+ if (!(preferred_data_types.Has(syncer::PROXY_TABS) &&
+ preferred_data_types.Has(syncer::PRIORITY_PREFERENCES))) {
return false;
+ }
return true;
}

Powered by Google App Engine
This is Rietveld 408576698