mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1241707 - [e10s] Web Console should restore focus to proper place when closed. r=jryans,r=bgrins
MozReview-Commit-ID: JlcJPGygm5F
This commit is contained in:
parent
88693264ac
commit
46ff855561
@ -12,6 +12,7 @@ var WebConsoleUtils = require("devtools/shared/webconsole/utils").Utils;
|
||||
var Heritage = require("sdk/core/heritage");
|
||||
var {TargetFactory} = require("devtools/client/framework/target");
|
||||
var {Tools} = require("devtools/client/definitions");
|
||||
const { Task } = require("resource://gre/modules/Task.jsm");
|
||||
var promise = require("promise");
|
||||
|
||||
loader.lazyImporter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
@ -587,10 +588,9 @@ WebConsole.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
let onDestroy = function WC_onDestroyUI() {
|
||||
let onDestroy = Task.async(function*() {
|
||||
try {
|
||||
let tabWindow = this.target.isLocalTab ? this.target.window : null;
|
||||
tabWindow && tabWindow.focus();
|
||||
yield this.target.activeTab.focus()
|
||||
}
|
||||
catch (ex) {
|
||||
// Tab focus can fail if the tab or target is closed.
|
||||
@ -599,7 +599,7 @@ WebConsole.prototype = {
|
||||
let id = WebConsoleUtils.supportsString(this.hudId);
|
||||
Services.obs.notifyObservers(id, "web-console-destroyed", null);
|
||||
this._destroyer.resolve(null);
|
||||
}.bind(this);
|
||||
}.bind(this));
|
||||
|
||||
if (this.ui) {
|
||||
this.ui.destroy().then(onDestroy);
|
||||
|
@ -1399,6 +1399,16 @@ TabActor.prototype = {
|
||||
return { type: "detached" };
|
||||
},
|
||||
|
||||
/**
|
||||
* Bring the tab's window to front.
|
||||
*/
|
||||
onFocus: function() {
|
||||
if (this.window) {
|
||||
this.window.focus();
|
||||
}
|
||||
return {};
|
||||
},
|
||||
|
||||
/**
|
||||
* Reload the page in this tab.
|
||||
*/
|
||||
@ -1900,6 +1910,7 @@ TabActor.prototype = {
|
||||
TabActor.prototype.requestTypes = {
|
||||
"attach": TabActor.prototype.onAttach,
|
||||
"detach": TabActor.prototype.onDetach,
|
||||
"focus": TabActor.prototype.onFocus,
|
||||
"reload": TabActor.prototype.onReload,
|
||||
"navigateTo": TabActor.prototype.onNavigateTo,
|
||||
"reconfigure": TabActor.prototype.onReconfigure,
|
||||
|
@ -1315,6 +1315,13 @@ TabClient.prototype = {
|
||||
telemetry: "TABDETACH"
|
||||
}),
|
||||
|
||||
/**
|
||||
* Bring the window to the front.
|
||||
*/
|
||||
focus: DebuggerClient.requester({
|
||||
type: "focus"
|
||||
}, {}),
|
||||
|
||||
/**
|
||||
* Reload the page in this tab.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user