зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 215f47ca940c (bug 1367077)
This commit is contained in:
Родитель
af50509c93
Коммит
5da3d8cab9
|
@ -3,9 +3,6 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Prompt",
|
||||
"resource://gre/modules/Prompt.jsm");
|
||||
|
||||
var InputWidgetHelper = {
|
||||
_uiBusy: false,
|
||||
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Prompt",
|
||||
"resource://gre/modules/Prompt.jsm");
|
||||
|
||||
var SelectHelper = {
|
||||
_uiBusy: false,
|
||||
|
||||
|
|
|
@ -45,15 +45,11 @@ BrowserCLH.prototype = {
|
|||
case "app-startup": {
|
||||
this.setResourceSubstitutions();
|
||||
|
||||
Services.obs.addObserver(this, "chrome-document-global-created");
|
||||
Services.obs.addObserver(this, "content-document-global-created");
|
||||
|
||||
GeckoViewUtils.addLazyGetter(this, "DownloadNotifications", {
|
||||
module: "resource://gre/modules/DownloadNotifications.jsm",
|
||||
observers: ["chrome-document-loaded"],
|
||||
once: true,
|
||||
});
|
||||
|
||||
if (AppConstants.MOZ_WEBRTC) {
|
||||
GeckoViewUtils.addLazyGetter(this, "WebrtcUI", {
|
||||
script: "chrome://browser/content/WebrtcUI.js",
|
||||
|
@ -67,31 +63,6 @@ BrowserCLH.prototype = {
|
|||
],
|
||||
});
|
||||
}
|
||||
|
||||
GeckoViewUtils.addLazyGetter(this, "SelectHelper", {
|
||||
script: "chrome://browser/content/SelectHelper.js",
|
||||
});
|
||||
GeckoViewUtils.addLazyGetter(this, "InputWidgetHelper", {
|
||||
script: "chrome://browser/content/InputWidgetHelper.js",
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
case "chrome-document-global-created":
|
||||
case "content-document-global-created": {
|
||||
let win = GeckoViewUtils.getChromeWindow(subject);
|
||||
if (win !== subject) {
|
||||
// Only attach to top-level windows.
|
||||
return;
|
||||
}
|
||||
|
||||
GeckoViewUtils.addLazyEventListener(win, "click", {
|
||||
handler: _ => [this.SelectHelper, this.InputWidgetHelper],
|
||||
options: {
|
||||
capture: true,
|
||||
mozSystemGroup: true,
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ contract @mozilla.org/prompter;1 {9a61149b-2276-4a0a-b79c-be994ad106cf}
|
|||
contract @mozilla.org/embedcomp/prompt-service;1 {9a61149b-2276-4a0a-b79c-be994ad106cf}
|
||||
component {80dae1e9-e0d2-4974-915f-f97050fa8068} PromptService.js
|
||||
contract @mozilla.org/network/authprompt-adapter-factory;1 {80dae1e9-e0d2-4974-915f-f97050fa8068}
|
||||
category app-startup PromptService service,@mozilla.org/prompter;1
|
||||
|
||||
# PresentationDevicePrompt.js
|
||||
component {388bd149-c919-4a43-b646-d7ec57877689} PresentationDevicePrompt.js
|
||||
|
|
|
@ -22,7 +22,46 @@ PromptService.prototype = {
|
|||
classID: Components.ID("{9a61149b-2276-4a0a-b79c-be994ad106cf}"),
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([
|
||||
Ci.nsIPromptFactory, Ci.nsIPromptService, Ci.nsIPromptService2]),
|
||||
Ci.nsIObserver, Ci.nsIPromptFactory, Ci.nsIPromptService, Ci.nsIPromptService2]),
|
||||
|
||||
loadSubscript: function(aName, aScript) {
|
||||
let sandbox = {};
|
||||
Services.scriptloader.loadSubScript(aScript, sandbox);
|
||||
return sandbox[aName];
|
||||
},
|
||||
|
||||
/* ---------- nsIObserver ---------- */
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
switch (aTopic) {
|
||||
case "app-startup": {
|
||||
Services.obs.addObserver(this, "chrome-document-global-created");
|
||||
Services.obs.addObserver(this, "content-document-global-created");
|
||||
break;
|
||||
}
|
||||
case "chrome-document-global-created":
|
||||
case "content-document-global-created": {
|
||||
let win = aSubject.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDocShell).QueryInterface(Ci.nsIDocShellTreeItem)
|
||||
.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindow);
|
||||
if (win !== aSubject) {
|
||||
// Only attach to top-level windows.
|
||||
return;
|
||||
}
|
||||
if (!this.selectHelper) {
|
||||
this.selectHelper = this.loadSubscript(
|
||||
"SelectHelper", "chrome://browser/content/SelectHelper.js");
|
||||
}
|
||||
if (!this.inputWidgetHelper) {
|
||||
this.inputWidgetHelper = this.loadSubscript(
|
||||
"InputWidgetHelper", "chrome://browser/content/InputWidgetHelper.js");
|
||||
}
|
||||
win.addEventListener("click", this.selectHelper, /* capture */ true);
|
||||
win.addEventListener("click", this.inputWidgetHelper, /* capture */ true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/* ---------- nsIPromptFactory ---------- */
|
||||
// XXX Copied from nsPrompter.js.
|
||||
|
|
Загрузка…
Ссылка в новой задаче