Bug 1023508 - Add telemetry for HiDPI usage. r=felipe

This commit is contained in:
Justin Dolske 2014-06-27 11:20:02 -07:00
parent 4bb7081c67
commit b6288566f1
2 changed files with 42 additions and 0 deletions

View File

@ -630,6 +630,22 @@ BrowserGlue.prototype = {
nb.PRIORITY_INFO_LOW, buttons);
},
_firstWindowTelemetry: function(aWindow) {
#ifdef XP_WIN
let SCALING_PROBE_NAME = "DISPLAY_SCALING_MSWIN";
#elifdef XP_MACOSX
let SCALING_PROBE_NAME = "DISPLAY_SCALING_OSX";
#elifdef XP_LINUX
let SCALING_PROBE_NAME = "DISPLAY_SCALING_LINUX";
#else
let SCALING_PROBE_NAME = "";
#endif
if (SCALING_PROBE_NAME) {
let scaling = aWindow.devicePixelRatio * 100;
Services.telemetry.getHistogramById(SCALING_PROBE_NAME).add(scaling);
}
},
// the first browser window has finished initializing
_onFirstWindowLoaded: function BG__onFirstWindowLoaded(aWindow) {
#ifdef XP_WIN
@ -658,6 +674,8 @@ BrowserGlue.prototype = {
}
this._checkForOldBuildUpdates();
this._firstWindowTelemetry(aWindow);
},
/**

View File

@ -6446,5 +6446,29 @@
"expires_in_version": "never",
"kind": "flag",
"description": "If a master-password is enabled for this profile"
},
"DISPLAY_SCALING_OSX" : {
"expires_in_version": "never",
"kind": "linear",
"high": "500",
"n_buckets": "100",
"description": "Scaling percentage for the display where the first window is opened (OS X only)",
"cpp_guard": "XP_MACOSX"
},
"DISPLAY_SCALING_MSWIN" : {
"expires_in_version": "never",
"kind": "linear",
"high": "500",
"n_buckets": "100",
"description": "Scaling percentage for the display where the first window is opened (MS Windows only)",
"cpp_guard": "XP_WIN"
},
"DISPLAY_SCALING_LINUX" : {
"expires_in_version": "never",
"kind": "linear",
"high": "500",
"n_buckets": "100",
"description": "Scaling percentage for the display where the first window is opened (Linux only)",
"cpp_guard": "XP_LINUX"
}
}