Bug 1275386 - Report through telemetry if the stub installer default browser checkbox was used and its results. r?rstrong
MozReview-Commit-ID: HnrGDXQh8cg
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1139,16 +1139,54 @@ BrowserGlue.prototype = {
}
this._checkForOldBuildUpdates();
if ("release" != AppConstants.MOZ_UPDATE_CHANNEL) {
this.checkForPendingCrashReports();
}
+ if (AppConstants.platform == "win") {
+ try {
+ Services.telemetry
+ .getHistogramById("STUB_INSTALLER_HIDE_DEFAULT_BROWSER_CHECKBOX")
+ .add(false);
+ } catch (ex) {}
+
+ let stubDefaultRequested =
+ WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\Firefox",
+ "DefaultBrowserRequested");
+ WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\Firefox",
+ "DefaultBrowserRequested");
+ if (stubDefaultRequested) {
+ try {
+ Services.telemetry
+ .getHistogramById("STUB_INSTALLER_SET_AS_DEFAULT_REQUESTED")
+ .add(stubDefaultRequested);
+ } catch (ex) {}
+ }
+
+ let stubDefaultResult =
+ WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\Firefox",
+ "DefaultBrowserResult");
+ WindowsRegistry.removeRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
+ "Software\\Mozilla\\Firefox",
+ "DefaultBrowserResult");
+ if (stubDefaultResult) {
+ try {
+ Services.telemetry
+ .getHistogramById("STUB_INSTALLER_SET_AS_DEFAULT_RESULT")
+ .add(stubDefaultResult);
+ } catch (ex) {}
+ }
+ }
+
this._firstWindowTelemetry(aWindow);
this._firstWindowLoaded();
},
/**
* Application shutdown handler.
*/
_onQuitApplicationGranted: function () {
--- a/browser/installer/windows/nsis/stub.nsi
+++ b/browser/installer/windows/nsis/stub.nsi
@@ -765,24 +765,29 @@ Function SendPing
$\nExisting Profile = $ExistingProfile \
$\nExisting Version = $ExistingVersion \
$\nExisting Build ID = $ExistingBuildID \
$\nNew Version = $R5 \
$\nNew Build ID = $R6 \
$\nDefault Install Dir = $R7 \
$\nHas Admin = $R8 \
$\nDefault Status = $R2 \
- $\nSet As Sefault Status = $R3 \
+ $\nSet As Default Status = $R3 \
$\nDownload Server IP = $DownloadServerIP \
$\nPost-Signing Data = $PostSigningData"
; The following will exit the installer
SetAutoClose true
StrCpy $R9 "2"
Call RelativeGotoPage
!else
+
+ WriteRegStr HKCU "Software\Mozilla\Firefox" "DefaultBrowserRequested" "$R3"
+ WriteRegStr HKCU "Software\Mozilla\Firefox" "DefaultBrowserResult" "$R2"
+ ClearErrors
+
${NSD_CreateTimer} OnPing ${DownloadIntervalMS}
InetBgDL::Get "${BaseURLStubPing}/${StubURLVersion}${StubURLVersionAppend}/${Channel}/${UpdateChannel}/${AB_CD}/$R0/$R1/$5/$6/$7/$8/$9/$ExitCode/$FirefoxLaunchCode/$DownloadRetryCount/$DownloadedBytes/$DownloadSizeBytes/$IntroPhaseSeconds/$OptionsPhaseSeconds/$0/$1/$DownloadFirstTransferSeconds/$2/$3/$4/$InitialInstallRequirementsCode/$OpenedDownloadPage/$ExistingProfile/$ExistingVersion/$ExistingBuildID/$R5/$R6/$R7/$R8/$R2/$R3/$DownloadServerIP/$PostSigningData" \
"$PLUGINSDIR\_temp" /END
!endif
${Else}
${If} "$IsDownloadFinished" == "false"
; Cancel the download in progress
InetBgDL::Get /RESET /END
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8113,16 +8113,36 @@
"BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS": {
"expires_in_version": "never",
"kind": "exponential",
"high": 500,
"n_buckets": 15,
"releaseChannelCollection": "opt-out",
"description": "Time to successfully set Firefox as the default browser after clicking 'Set Firefox as Default'. Should be near-instant in some environments, others require user interaction. Measured in seconds."
},
+ "STUB_INSTALLER_HIDE_DEFAULT_BROWSER_CHECKBOX": {
+ "expires_in_version": "53",
+ "kind": "boolean",
+ "releaseChannelCollection": "opt-out",
+ "description": "True if the checkbox to set the browser as default was hidden in the installer (Windows only)"
+ },
+ "STUB_INSTALLER_SET_AS_DEFAULT_REQUESTED": {
+ "expires_in_version": "53",
+ "kind": "enumerated",
+ "n_values": 4,
+ "releaseChannelCollection": "opt-out",
+ "description": "If Firefox was requested to be set as default from the stub installer (Windows only). (0=Cannot set as default, Win7 or less, 1=Cannot set as default, at least Win8, 2=Can set as default and set as default requested, 3=Can set as default but 'set as default' was not requested)"
+ },
+ "STUB_INSTALLER_SET_AS_DEFAULT_RESULT": {
+ "expires_in_version": "53",
+ "kind": "enumerated",
+ "n_values": 3,
+ "releaseChannelCollection": "opt-out",
+ "description": "The result of attempting to set Firefox as the default in the stub installer (Windows only). (0=Firefox is not set as default, 1=This Firefox install is set as default, 2=Another Firefox install is set as default)"
+ },
"BROWSER_IS_ASSIST_DEFAULT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "The result of the default browser check for assist intent."
},
"MIXED_CONTENT_PAGE_LOAD": {
"expires_in_version": "never",
"kind": "enumerated",