bug 903426. Add options for sending URLs with crash reports or not. r=jimm,mbrubeck

This commit is contained in:
Tim Abraldes 2013-12-05 22:08:02 -08:00
Родитель 875d88139d
Коммит 9faa499d9d
7 изменённых файлов: 67 добавлений и 3 удалений

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

@ -609,8 +609,12 @@ var BrowserUI = {
if (lastCrashID && lastCrashID.length) {
if (Services.prefs.getBoolPref("app.crashreporter.autosubmit")) {
Util.dumpLn("Submitting last crash id:", lastCrashID);
let params = {};
if (!Services.prefs.getBoolPref("app.crashreporter.submitURLs")) {
params['extraExtraKeyVals'] = { URL: '' };
}
try {
this.CrashSubmit.submit(lastCrashID);
this.CrashSubmit.submit(lastCrashID, params);
} catch (ex) {
Util.dumpLn(ex);
}

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

@ -672,7 +672,13 @@ Desktop browser's sync prefs.
</settings>
<setting pref="signon.rememberSignons" title="&optionsHeader.privacy.passwords.label;" type="bool"/>
<settings id="prefs-reporting" label="&optionsHeader.reporting.title;">
<setting pref="app.crashreporter.autosubmit" type="bool" title="&optionsHeader.reporting.crashes.label;" />
<setting pref="app.crashreporter.autosubmit"
type="bool"
title="&optionsHeader.reporting.crashes.label;" />
<setting pref="app.crashreporter.submitURLs"
id="prefs-reporting-submitURLs"
type="bool"
title="&optionsHeader.reporting.crashes.submitURLs;" />
</settings>
<settings id="prefs-telemetry" label="&optionsHeader.telemetry.title;">
<setting pref="toolkit.telemetry.enabled" type="bool" title="&optionsHeader.telemetry.label;"/>

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

@ -44,6 +44,12 @@ let PrefsFlyoutPanel = {
Services.prefs.addObserver("privacy.donottrackheader.enabled",
this._prefObserver,
false);
Services.prefs.addObserver("app.crashreporter.autosubmit",
this._prefObserver,
false);
Services.prefs.addObserver("app.crashreporter.submitURLs",
this._prefObserver,
false);
}
this._topmostElement.show();
@ -81,6 +87,29 @@ let PrefsFlyoutPanel = {
Services.prefs.setIntPref('privacy.donottrackheader.value', -1);
}
break;
case "app.crashreporter.autosubmit":
let autosubmit = Services.prefs.getBoolPref("app.crashreporter.autosubmit");
if (!autosubmit) {
// If the user has selected not to submit crash reports, the UI
// should reflect also that URLs will not be included.
// TODO: Ideally we would grey out the text and the toggle for
// the "include URLs" pref, but the |setting| binding doesn't
// appear to support enabling/disabling. In the meantime, we just
// set the "include URLs" pref to false if the "send crash reports"
// pref has been set to false.
Services.prefs.setBoolPref('app.crashreporter.submitURLs', false);
}
break;
case "app.crashreporter.submitURLs":
let submitURLs = Services.prefs.getBoolPref("app.crashreporter.submitURLs");
if (submitURLs) {
// If the user has selected to submit URLs, they are implicitly also
// selecting to submit crash reports. Let's update the autosubmit pref
Services.prefs.setBoolPref('app.crashreporter.autosubmit', true);
}
break;
}
},
};

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

@ -53,6 +53,14 @@
function onChoseSendReports() {
Services.prefs.setBoolPref("app.crashreporter.prompted", true);
Services.prefs.setBoolPref("app.crashreporter.autosubmit", true);
var includeURLCheckbox = document.getElementById("crashpromptIncludeURLCheckbox");
if (includeURLCheckbox.checked) {
Services.prefs.setBoolPref("app.crashreporter.submitURLs", true);
} else {
Services.prefs.setBoolPref("app.crashreporter.submitURLs", false);
}
window.close();
}
@ -61,11 +69,17 @@
Services.prefs.setBoolPref("app.crashreporter.autosubmit", false);
window.close();
}
function onLoad() {
document.getElementById("crashpromptIncludeURLCheckbox").checked =
Services.prefs.getBoolPref("app.crashreporter.submitURLs");
}
]]></script>
</head>
<body id="crashPromptPage" dir="&locale.dir;">
<body id="crashPromptPage" dir="&locale.dir;" onload="onLoad();">
<div id="crashPromptContainer">
<h1 id="crashPromptTitle">&crashprompt.title;</h1>
<hr id="crashPromptSeparator" />
@ -95,6 +109,13 @@
</label>
</div>
</p>
<div id="crashpromptURLCheckboxContainer">
<label id="crashpromptIncludeURLLabel">
<input type="checkbox"
id="crashpromptIncludeURLCheckbox" />
&crashprompt.includeURLLabel;
</label>
</div>
<div id="crashPromptButtonContainer">
<button class="button-default"
onclick="onChoseSendReports();">

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

@ -10,6 +10,7 @@
<!ENTITY crashprompt.detailedMessage.secondParagraph "This may include things like open pages, text typed into forms and the content of open messages, recent browsing history, or geolocation shared with a site.">
<!ENTITY crashprompt.detailedMessage.thirdParagraph "We use crash reports to try to fix problems and improve our products. We handle your information as we describe in our ">
<!ENTITY crashprompt.privacyPolicyLink "&brandShortName; privacy policy">
<!ENTITY crashprompt.includeURLLabel "Include the address of the page I was on">
<!ENTITY crashprompt.acceptbutton "Send reports">
<!ENTITY crashprompt.refusebutton "Don't send">
<!ENTITY crashprompt.privacyPolicy.title "&brandShortName; privacy policy">

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

@ -35,5 +35,6 @@
<!ENTITY optionsHeader.reporting.title "Crash Reporter">
<!ENTITY optionsHeader.reporting.crashes.label "&brandShortName; submits crash reports to help Mozilla make your browser more stable and secure">
<!ENTITY optionsHeader.reporting.crashes.submitURLs "Include the address of the page I was on">
<!ENTITY optionsHeader.telemetry.title "Telemetry">
<!ENTITY optionsHeader.telemetry.label "Shares usage statistics about &brandShortName; with Mozilla to help us make your browser better">

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

@ -18,9 +18,11 @@ pref("devtools.chrome.enabled", false);
// Automatically submit crash reports
#ifdef RELEASE_BUILD
pref("app.crashreporter.autosubmit", false);
pref("app.crashreporter.submitURLs", false);
#else
// For Nightly and Aurora we turn this on by default
pref("app.crashreporter.autosubmit", true);
pref("app.crashreporter.submitURLs", false);
#endif
// Has the user been prompted about crash reporting?
pref("app.crashreporter.prompted", false);