Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / extensions / ExtensionView.js
index d3eb764..f5e52f9 100644 (file)
 /**
  * @constructor
  * @extends {WebInspector.View}
+ * @param {!WebInspector.ExtensionServer} server
  * @param {string} id
  * @param {string} src
  * @param {string} className
  */
-WebInspector.ExtensionView = function(id, src, className)
+WebInspector.ExtensionView = function(server, id, src, className)
 {
     WebInspector.View.call(this);
     this.element.className = "extension-view fill"; // Override
 
+    this._server = server;
     this._id = id;
-    this._iframe = document.createElement("iframe");
+    this._iframe = createElement("iframe");
     this._iframe.addEventListener("load", this._onLoad.bind(this), false);
     this._iframe.src = src;
     this._iframe.className = className;
@@ -54,13 +56,13 @@ WebInspector.ExtensionView.prototype = {
     wasShown: function()
     {
         if (typeof this._frameIndex === "number")
-            WebInspector.extensionServer.notifyViewShown(this._id, this._frameIndex);
+            this._server.notifyViewShown(this._id, this._frameIndex);
     },
 
     willHide: function()
     {
         if (typeof this._frameIndex === "number")
-            WebInspector.extensionServer.notifyViewHidden(this._id);
+            this._server.notifyViewHidden(this._id);
     },
 
     _onLoad: function()
@@ -68,7 +70,7 @@ WebInspector.ExtensionView.prototype = {
         var frames = /** @type {!Array.<!Window>} */ (window.frames);
         this._frameIndex = Array.prototype.indexOf.call(frames, this._iframe.contentWindow);
         if (this.isShowing())
-            WebInspector.extensionServer.notifyViewShown(this._id, this._frameIndex);
+            this._server.notifyViewShown(this._id, this._frameIndex);
     },
 
     __proto__: WebInspector.View.prototype
@@ -77,24 +79,26 @@ WebInspector.ExtensionView.prototype = {
 /**
  * @constructor
  * @extends {WebInspector.VBox}
+ * @param {!WebInspector.ExtensionServer} server
  * @param {string} id
  */
-WebInspector.ExtensionNotifierView = function(id)
+WebInspector.ExtensionNotifierView = function(server, id)
 {
     WebInspector.VBox.call(this);
 
+    this._server = server;
     this._id = id;
 }
 
 WebInspector.ExtensionNotifierView.prototype = {
     wasShown: function()
     {
-        WebInspector.extensionServer.notifyViewShown(this._id);
+        this._server.notifyViewShown(this._id);
     },
 
     willHide: function()
     {
-        WebInspector.extensionServer.notifyViewHidden(this._id);
+        this._server.notifyViewHidden(this._id);
     },
 
     __proto__: WebInspector.VBox.prototype