| 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 da9e4f1471ddf000dbf74c01c44ad6460328c238..9ddfcf5a3393199dfb44a1293ce75b8b9a1eee25 100644
|
| --- a/chrome/browser/permissions/permission_uma_util.cc
|
| +++ b/chrome/browser/permissions/permission_uma_util.cc
|
| @@ -60,6 +60,8 @@ using content::PermissionType;
|
|
|
| namespace {
|
|
|
| +static bool gIsFakeOfficialBuildForTest = false;
|
| +
|
| const std::string GetRapporMetric(ContentSettingsType permission,
|
| PermissionAction action) {
|
| std::string action_str;
|
| @@ -577,12 +579,24 @@ void PermissionUmaUtil::PermissionPromptDeniedWithPersistenceToggle(
|
| }
|
| }
|
|
|
| +void PermissionUmaUtil::FakeOfficialBuildForTest() {
|
| + gIsFakeOfficialBuildForTest = true;
|
| +}
|
| +
|
| bool PermissionUmaUtil::IsOptedIntoPermissionActionReporting(Profile* profile) {
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kDisablePermissionActionReporting)) {
|
| return false;
|
| }
|
|
|
| + bool official_build = gIsFakeOfficialBuildForTest;
|
| +#if defined(OFFICIAL_BUILD) && defined(GOOGLE_CHROME_BUILD)
|
| + official_build = true;
|
| +#endif
|
| +
|
| + if (!official_build)
|
| + return false;
|
| +
|
| DCHECK(profile);
|
| if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE)
|
| return false;
|
|
|