Bug 1061669 - Expose a setActive API on mozbrowser iframe. r=fabrice
authorVivien Nicolas <vnicolas@mozilla.com>
Mon, 06 Oct 2014 14:32:55 +0200
changeset 209007 49e90971088e824b596fdb0a21e6899a0587d57c
parent 209006 ecd4f1368b7ac0fecac8dbd231da732fec39baa3
child 209008 c2971c67412a887f0ffd02b5164d3b951be57a95
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersfabrice
bugs1061669
milestone35.0a1
Bug 1061669 - Expose a setActive API on mozbrowser iframe. r=fabrice
dom/browser-element/BrowserElementParent.jsm
--- a/dom/browser-element/BrowserElementParent.jsm
+++ b/dom/browser-element/BrowserElementParent.jsm
@@ -139,16 +139,18 @@ function BrowserElementParent(frameLoade
 
     defineDOMRequestMethod('getCanGoBack', 'get-can-go-back');
     defineDOMRequestMethod('getCanGoForward', 'get-can-go-forward');
     defineDOMRequestMethod('getContentDimensions', 'get-contentdimensions');
   }
 
   defineMethod('addNextPaintListener', this._addNextPaintListener);
   defineMethod('removeNextPaintListener', this._removeNextPaintListener);
+  defineNoReturnMethod('setActive', this._setActive);
+  defineMethod('getActive', 'this._getActive');
 
   let principal = this._frameElement.ownerDocument.nodePrincipal;
   let perm = Services.perms
              .testExactPermissionFromPrincipal(principal, "input-manage");
   if (perm === Ci.nsIPermissionManager.ALLOW_ACTION) {
     defineMethod('setInputMethodActive', this._setInputMethodActive);
   }
 
@@ -582,16 +584,24 @@ BrowserElementParent.prototype = {
     }
   },
 
   _setVisible: function(visible) {
     this._sendAsyncMsg('set-visible', {visible: visible});
     this._frameLoader.visible = visible;
   },
 
+  _setActive: function(active) {
+    this._frameLoader.visible = active;
+  },
+
+  _getActive: function() {
+    return this._frameLoader.visible;
+  },
+
   _sendMouseEvent: function(type, x, y, button, clickCount, modifiers) {
     this._sendAsyncMsg("send-mouse-event", {
       "type": type,
       "x": x,
       "y": y,
       "button": button,
       "clickCount": clickCount,
       "modifiers": modifiers