Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Unified Diff: extensions/renderer/resources/web_view.js

Issue 564973004: Move ContentWindow from BrowserPlugin To GuestView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698