Chromium Code Reviews| Index: extensions/renderer/resources/web_view.js | 
| diff --git a/extensions/renderer/resources/web_view.js b/extensions/renderer/resources/web_view.js | 
| index 85c588c4071d278d553b7b4a359b24339ad41652..b36f804a6fe5601e0caf74bbb45fc9318d3b4119 100644 | 
| --- a/extensions/renderer/resources/web_view.js | 
| +++ b/extensions/renderer/resources/web_view.js | 
| @@ -166,6 +166,7 @@ WebViewInternal.prototype.reset = function() { | 
| this.beforeFirstNavigation = true; | 
| this.validPartitionId = true; | 
| this.partition.validPartitionId = true; | 
| + this.contentWindow = null; | 
| 
 
lazyboy
2014/09/17 18:24:01
This should be done in the constructor as well.
 
Fady Samuel
2014/09/17 20:25:46
Done.
 
 | 
| } | 
| this.internalInstanceId = 0; | 
| }; | 
| @@ -419,10 +420,10 @@ WebViewInternal.prototype.setupWebviewNodeProperties = function() { | 
| // dynamic getter value. | 
| Object.defineProperty(this.webviewNode, 'contentWindow', { | 
| get: function() { | 
| - if (browserPluginNode.contentWindow) | 
| - return browserPluginNode.contentWindow; | 
| + if (this.contentWindow) | 
| + return this.contentWindow; | 
| window.console.error(ERROR_MSG_CONTENTWINDOW_NOT_AVAILABLE); | 
| - }, | 
| + }.bind(this), | 
| // No setter. | 
| enumerable: true | 
| }); | 
| @@ -575,7 +576,11 @@ WebViewInternal.prototype.handleBrowserPluginAttributeMutation = | 
| guestViewInternalNatives.AttachGuest( | 
| this.internalInstanceId, | 
| this.guestInstanceId, | 
| - params); | 
| + params, | 
| + function(w) { | 
| + this.contentWindow = w; | 
| + //window.console.log(w); | 
| 
 
lazyboy
2014/09/17 18:24:01
Remove
 
Fady Samuel
2014/09/17 20:25:47
Done.
 
 | 
| + }.bind(this)); | 
| }.bind(this), 0); | 
| } | 
| @@ -879,7 +884,9 @@ WebViewInternal.prototype.attachWindow = function(guestInstanceId, | 
| return guestViewInternalNatives.AttachGuest( | 
| this.internalInstanceId, | 
| this.guestInstanceId, | 
| - params); | 
| + params, function(w) { | 
| + this.contentWindow = w; | 
| + }.bind(this)); | 
| }; | 
| // Registers browser plugin <object> custom element. |