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

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

Issue 2887613003: Only collect Permission Action Reporting data in official builds (Closed)
Patch Set: Make it fail even without DCHECKS Created 3 years, 7 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 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;
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.h ('k') | chrome/browser/permissions/permission_uma_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698