Chromium Code Reviews| 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..7d8c5a95ca199efd95296579667a72002b4fdf57 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,25 @@ void PermissionUmaUtil::PermissionPromptDeniedWithPersistenceToggle( |
| } |
| } |
| +void PermissionUmaUtil::FakeOfficialBuildForTest() { |
| + gIsFakeOfficialBuildForTest = true; |
|
vakh (use Gerrit instead)
2017/05/25 01:59:17
Perhaps add a CHECK(false) here for official build
benwells
2017/05/25 02:03:37
The CHECK below is just for an experiment, not to
|
| +} |
| + |
| 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; |
| + CHECK(false); |
|
vakh (use Gerrit instead)
2017/05/25 01:59:17
I must be reading this incorrectly but it looks li
benwells
2017/05/25 02:03:37
Sorry, this is just an experiment I'm doing to see
|
| +#endif |
| + |
| + if (!official_build) |
| + return false; |
| + |
| DCHECK(profile); |
| if (profile->GetProfileType() == Profile::INCOGNITO_PROFILE) |
| return false; |