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

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

Issue 119743002: Make WebView work with either enteredViewCallback or attachedCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Retry upload. Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/web_view.js
diff --git a/chrome/renderer/resources/extensions/web_view.js b/chrome/renderer/resources/extensions/web_view.js
index dfdded8d9c280963225160277b32e68adb1ea3c9..d827f3fbe2cda853eaa3dbcd20fcc041967bd1b8 100644
--- a/chrome/renderer/resources/extensions/web_view.js
+++ b/chrome/renderer/resources/extensions/web_view.js
@@ -934,19 +934,29 @@ function registerBrowserPluginElement() {
internal.handleBrowserPluginAttributeMutation_(name, newValue);
};
- proto.enteredViewCallback = function() {
+ proto.attachedCallback = function() {
// Load the plugin immediately.
var unused = this.nonExistentAttribute;
};
+ // TODO(dominicc): Remove this line once Custom Elements renames
+ // enteredViewCallback to attachedCallback
+ proto.enteredViewCallback = proto.attachedCallback;
+
WebViewInternal.BrowserPlugin =
DocumentNatives.RegisterElement('browser-plugin', {extends: 'object',
prototype: proto});
delete proto.createdCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
+ delete proto.attributeChangedCallback;
+
+ // TODO(dominicc): Remove these lines once Custom Elements renames
+ // enteredView, leftView callbacks to attached, detached
+ // respectively.
delete proto.enteredViewCallback;
delete proto.leftViewCallback;
- delete proto.attributeChangedCallback;
}
// Registers <webview> custom element.
@@ -1015,9 +1025,15 @@ function registerWebViewElement() {
// Delete the callbacks so developers cannot call them and produce unexpected
// behavior.
delete proto.createdCallback;
+ delete proto.attachedCallback;
+ delete proto.detachedCallback;
+ delete proto.attributeChangedCallback;
+
+ // TODO(dominicc): Remove these lines once Custom Elements renames
+ // enteredView, leftView callbacks to attached, detached
+ // respectively.
delete proto.enteredViewCallback;
delete proto.leftViewCallback;
- delete proto.attributeChangedCallback;
}
var useCapture = true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698