Bug 1228090 - Update traacking protection telemetry histogram to represent user setting. r=mfinkle

--HG--
extra : commitid : ID0STPnNMfB
extra : rebase_source : 205146246a35eee158845fec4b788edd7018dafa
This commit is contained in:
Margaret Leibovic 2015-12-18 14:30:24 -05:00
Родитель ffff16ffeb
Коммит d59e4ae5e8
2 изменённых файлов: 24 добавлений и 11 удалений

Просмотреть файл

@ -594,10 +594,7 @@ var BrowserApp = {
if (AppConstants.NIGHTLY_BUILD) {
InitLater(() => ShumwayUtils.init(), window, "ShumwayUtils");
InitLater(() => Telemetry.addData("TRACKING_PROTECTION_ENABLED",
Services.prefs.getBoolPref("privacy.trackingprotection.enabled")));
InitLater(() => Telemetry.addData("TRACKING_PROTECTION_PBM_DISABLED",
!Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled")));
InitLater(() => Telemetry.addData("FENNEC_TRACKING_PROTECTION_STATE", parseInt(BrowserApp.getTrackingProtectionState())));
InitLater(() => WebcompatReporter.init());
}
@ -1448,6 +1445,20 @@ var BrowserApp = {
PREF_TRACKING_PROTECTION_ENABLED_PB: "1",
PREF_TRACKING_PROTECTION_DISABLED: "0",
/**
* Returns the current state of the tracking protection pref.
* (0 = Disabled, 1 = Enabled in PB, 2 = Enabled)
*/
getTrackingProtectionState: function() {
if (Services.prefs.getBoolPref("privacy.trackingprotection.enabled")) {
return this.PREF_TRACKING_PROTECTION_ENABLED;
}
if (Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled")) {
return this.PREF_TRACKING_PROTECTION_ENABLED_PB;
}
return this.PREF_TRACKING_PROTECTION_DISABLED;
},
handlePreferencesRequest: function handlePreferencesRequest(aRequestId,
aPrefNames,
aListen) {
@ -1488,13 +1499,7 @@ var BrowserApp = {
continue;
case "privacy.trackingprotection.state": {
pref.type = "string";
if (Services.prefs.getBoolPref("privacy.trackingprotection.enabled")) {
pref.value = this.PREF_TRACKING_PROTECTION_ENABLED;
} else if (Services.prefs.getBoolPref("privacy.trackingprotection.pbmode.enabled")) {
pref.value = this.PREF_TRACKING_PROTECTION_ENABLED_PB;
} else {
pref.value = this.PREF_TRACKING_PROTECTION_DISABLED;
}
pref.value = this.getTrackingProtectionState();
prefs.push(pref);
continue;
}

Просмотреть файл

@ -8472,6 +8472,14 @@
"kind": "boolean",
"description": "Is the tracking protection in private browsing mode disabled?"
},
"FENNEC_TRACKING_PROTECTION_STATE": {
"expires_in_version": "60",
"kind": "enumerated",
"n_values": 5,
"description": "The state of the user-visible tracking protection setting (0 = Disabled, 1 = Enabled in PB, 2 = Enabled)",
"alert_emails": ["mleibovic@mozilla.com"],
"bug_numbers": [1228090]
},
"TRACKING_PROTECTION_SHIELD": {
"expires_in_version": "never",
"kind": "enumerated",