OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/permissions/permission_uma_util.h" | 5 #include "chrome/browser/permissions/permission_uma_util.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 switches::kDisablePermissionActionReporting)) { | 567 switches::kDisablePermissionActionReporting)) { |
568 return false; | 568 return false; |
569 } | 569 } |
570 | 570 |
571 DCHECK(profile); | 571 DCHECK(profile); |
572 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE) | 572 if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE) |
573 return false; | 573 return false; |
574 if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) | 574 if (!profile->GetPrefs()->GetBoolean(prefs::kSafeBrowsingEnabled)) |
575 return false; | 575 return false; |
576 | 576 |
577 ProfileSyncService* profile_sync_service = | 577 browser_sync::ProfileSyncService* profile_sync_service = |
578 ProfileSyncServiceFactory::GetForProfile(profile); | 578 ProfileSyncServiceFactory::GetForProfile(profile); |
579 | 579 |
580 // Do not report if profile can't get a profile sync service or sync cannot | 580 // Do not report if profile can't get a profile sync service or sync cannot |
581 // start. | 581 // start. |
582 if (!(profile_sync_service && profile_sync_service->CanSyncStart())) | 582 if (!(profile_sync_service && profile_sync_service->CanSyncStart())) |
583 return false; | 583 return false; |
584 | 584 |
585 // Do not report for users with a Custom passphrase set. We need to wait for | 585 // Do not report for users with a Custom passphrase set. We need to wait for |
586 // Sync to be active in order to check the passphrase, so we don't report if | 586 // Sync to be active in order to check the passphrase, so we don't report if |
587 // Sync is not active yet. | 587 // Sync is not active yet. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 if (!deprecated_metric.empty() && rappor_service) { | 696 if (!deprecated_metric.empty() && rappor_service) { |
697 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, | 697 rappor::SampleDomainAndRegistryFromGURL(rappor_service, deprecated_metric, |
698 requesting_origin); | 698 requesting_origin); |
699 | 699 |
700 std::string rappor_metric = deprecated_metric + "2"; | 700 std::string rappor_metric = deprecated_metric + "2"; |
701 rappor_service->RecordSample( | 701 rappor_service->RecordSample( |
702 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, | 702 rappor_metric, rappor::LOW_FREQUENCY_ETLD_PLUS_ONE_RAPPOR_TYPE, |
703 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); | 703 rappor::GetDomainAndRegistrySampleFromGURL(requesting_origin)); |
704 } | 704 } |
705 } | 705 } |
OLD | NEW |