Bug 927424 - Allow findbar binding to cancel content focusing when using RemoteFinder in an e10s window. r=evilpie.

--HG--
extra : source : 2f6420722723035b1ed11e5de8e1829e827552fa
This commit is contained in:
Mike Conley 2014-09-04 15:17:47 -04:00
parent 3a5ea8be83
commit 75a5bb9529
2 changed files with 16 additions and 8 deletions

View File

@ -197,9 +197,12 @@ Finder.prototype = {
// Allow Finder listeners to cancel focusing the content.
for (let l of this._listeners) {
try {
if (!l.shouldFocusContent())
if ("shouldFocusContent" in l &&
!l.shouldFocusContent())
return;
} catch (ex) {}
} catch (ex) {
Cu.reportError(ex);
}
}
let fastFind = this._fastFind;

View File

@ -83,6 +83,17 @@ RemoteFinder.prototype = {
},
focusContent: function () {
// Allow Finder listeners to cancel focusing the content.
for (let l of this._listeners) {
try {
if ("shouldFocusContent" in l &&
!l.shouldFocusContent())
return;
} catch (ex) {
Cu.reportError(ex);
}
}
this._browser.messageManager.sendAsyncMessage("Finder:FocusContent");
},
@ -134,12 +145,6 @@ RemoteFinderListener.prototype = {
this._global.sendAsyncMessage("Finder:MatchesResult", aData);
},
//XXXmikedeboer-20131016: implement |shouldFocusContent| here to mitigate
// issues like bug 921338 and bug 921308.
shouldFocusContent: function () {
return true;
},
receiveMessage: function (aMessage) {
let data = aMessage.data;