mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 787738 - Telemetry for Geolocation Prompt UI (r=felipe)
This commit is contained in:
parent
0eb28a561b
commit
bb7b5d9d54
@ -1638,11 +1638,15 @@ ContentPermissionPrompt.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
var browserBundle = Services.strings.createBundle("chrome://browser/locale/browser.properties");
|
||||||
|
let secHistogram = Components.classes["@mozilla.org/base/telemetry;1"].
|
||||||
|
getService(Ci.nsITelemetry).
|
||||||
|
getHistogramById("SECURITY_UI");
|
||||||
|
|
||||||
var mainAction = {
|
var mainAction = {
|
||||||
label: browserBundle.GetStringFromName("geolocation.shareLocation"),
|
label: browserBundle.GetStringFromName("geolocation.shareLocation"),
|
||||||
accessKey: browserBundle.GetStringFromName("geolocation.shareLocation.accesskey"),
|
accessKey: browserBundle.GetStringFromName("geolocation.shareLocation.accesskey"),
|
||||||
callback: function() {
|
callback: function() {
|
||||||
|
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_SHARE_LOCATION);
|
||||||
request.allow();
|
request.allow();
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -1667,6 +1671,7 @@ ContentPermissionPrompt.prototype = {
|
|||||||
accessKey: browserBundle.GetStringFromName("geolocation.alwaysShareLocation.accesskey"),
|
accessKey: browserBundle.GetStringFromName("geolocation.alwaysShareLocation.accesskey"),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
Services.perms.addFromPrincipal(requestingPrincipal, "geo", Ci.nsIPermissionManager.ALLOW_ACTION);
|
Services.perms.addFromPrincipal(requestingPrincipal, "geo", Ci.nsIPermissionManager.ALLOW_ACTION);
|
||||||
|
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_ALWAYS_SHARE);
|
||||||
request.allow();
|
request.allow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1675,6 +1680,7 @@ ContentPermissionPrompt.prototype = {
|
|||||||
accessKey: browserBundle.GetStringFromName("geolocation.neverShareLocation.accesskey"),
|
accessKey: browserBundle.GetStringFromName("geolocation.neverShareLocation.accesskey"),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
Services.perms.addFromPrincipal(requestingPrincipal, "geo", Ci.nsIPermissionManager.DENY_ACTION);
|
Services.perms.addFromPrincipal(requestingPrincipal, "geo", Ci.nsIPermissionManager.DENY_ACTION);
|
||||||
|
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST_NEVER_SHARE);
|
||||||
request.cancel();
|
request.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1683,6 +1689,7 @@ ContentPermissionPrompt.prototype = {
|
|||||||
|
|
||||||
var browser = chromeWin.gBrowser.getBrowserForDocument(requestingWindow.document);
|
var browser = chromeWin.gBrowser.getBrowserForDocument(requestingWindow.document);
|
||||||
|
|
||||||
|
secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_GEOLOCATION_REQUEST);
|
||||||
chromeWin.PopupNotifications.show(browser, "geolocation", message, "geo-notification-icon",
|
chromeWin.PopupNotifications.show(browser, "geolocation", message, "geo-notification-icon",
|
||||||
mainAction, secondaryActions);
|
mainAction, secondaryActions);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
|
|
||||||
[scriptable, uuid(454b5cbb-fd18-4f34-a616-4d543f68717d)]
|
[scriptable, uuid(f277021f-8508-456e-b2b2-784c6faa0011)]
|
||||||
|
|
||||||
interface nsISecurityUITelemetry : nsISupports {
|
interface nsISecurityUITelemetry : nsISupports {
|
||||||
|
|
||||||
@ -83,4 +83,15 @@ const uint32_t WARNING_BAD_CERT_CONFIRM_ADD_EXCEPTION_FLAG_DOMAIN = 2;
|
|||||||
const uint32_t WARNING_BAD_CERT_CONFIRM_ADD_EXCEPTION_FLAG_TIME = 4;
|
const uint32_t WARNING_BAD_CERT_CONFIRM_ADD_EXCEPTION_FLAG_TIME = 4;
|
||||||
// This uses up buckets till 45
|
// This uses up buckets till 45
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Geolocation Popup Telemetry
|
||||||
|
*/
|
||||||
|
|
||||||
|
const uint32_t WARNING_GEOLOCATION_REQUEST = 46;
|
||||||
|
const uint32_t WARNING_GEOLOCATION_REQUEST_SHARE_LOCATION = 47;
|
||||||
|
const uint32_t WARNING_GEOLOCATION_REQUEST_ALWAYS_SHARE = 48;
|
||||||
|
const uint32_t WARNING_GEOLOCATION_REQUEST_NEVER_SHARE = 49;
|
||||||
|
// It would be nice to measure the two cases of user clicking
|
||||||
|
// "not now", and user closing the popup. This is currently not implemented.
|
||||||
|
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user