mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 942244 - [Australis] Add BrowserUiTelemetry module for collecting toolbar measurements. r=dao.
This commit is contained in:
parent
9da681c2b2
commit
0047869f02
@ -79,6 +79,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
|
||||
"resource:///modules/sessionstore/SessionStore.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUITelemetry",
|
||||
"resource:///modules/BrowserUITelemetry.jsm");
|
||||
|
||||
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
|
||||
const PREF_PLUGINS_UPDATEURL = "plugins.update.url";
|
||||
|
||||
@ -476,6 +479,7 @@ BrowserGlue.prototype = {
|
||||
webrtcUI.init();
|
||||
AboutHome.init();
|
||||
SessionStore.init();
|
||||
BrowserUITelemetry.init();
|
||||
|
||||
if (Services.prefs.getBoolPref("browser.tabs.remote"))
|
||||
ContentClick.init();
|
||||
|
43
browser/modules/BrowserUITelemetry.jsm
Normal file
43
browser/modules/BrowserUITelemetry.jsm
Normal file
@ -0,0 +1,43 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
"use strict";
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["BrowserUITelemetry"];
|
||||
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "UITelemetry",
|
||||
"resource://gre/modules/UITelemetry.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "RecentWindow",
|
||||
"resource:///modules/RecentWindow.jsm");
|
||||
|
||||
this.BrowserUITelemetry = {
|
||||
init: function() {
|
||||
UITelemetry.addSimpleMeasureFunction("toolbars",
|
||||
this.getToolbarMeasures.bind(this));
|
||||
},
|
||||
|
||||
getToolbarMeasures: function() {
|
||||
// Grab the most recent non-popup, non-private browser window for us to
|
||||
// analyze the toolbars in...
|
||||
let win = RecentWindow.getMostRecentBrowserWindow({
|
||||
private: false,
|
||||
allowPopups: false
|
||||
});
|
||||
|
||||
// If there are no such windows, we're out of luck. :(
|
||||
if (!win) {
|
||||
return {};
|
||||
}
|
||||
|
||||
let document = win.document;
|
||||
let result = {};
|
||||
|
||||
return result;
|
||||
},
|
||||
};
|
@ -8,6 +8,7 @@ TEST_DIRS += ['test']
|
||||
|
||||
EXTRA_JS_MODULES += [
|
||||
'BrowserNewTabPreloader.jsm',
|
||||
'BrowserUITelemetry.jsm',
|
||||
'CharsetMenu.jsm',
|
||||
'ContentClick.jsm',
|
||||
'NetworkPrioritizer.jsm',
|
||||
|
Loading…
Reference in New Issue
Block a user