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

Unified Diff: extensions/renderer/resources/guest_view/extension_view_attributes.js

Issue 929453002: <webview> + <extensionview>: Create a maybeHandleMutation call into attributes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/guest_view/extension_view_attributes.js
diff --git a/extensions/renderer/resources/guest_view/extension_view_attributes.js b/extensions/renderer/resources/guest_view/extension_view_attributes.js
index 06f5598a14c56ba6a52a7403fbdb62b05973ff4e..d4bc0d61ec573a3e6635558c66ff4e2dbce9a819 100644
--- a/extensions/renderer/resources/guest_view/extension_view_attributes.js
+++ b/extensions/renderer/resources/guest_view/extension_view_attributes.js
@@ -55,6 +55,16 @@ ExtensionViewAttribute.prototype.defineProperty = function() {
};
// Called when the attribute's value changes.
+ExtensionViewAttribute.prototype.maybeHandleMutation =
+ function(oldValue, newValue) {
+ if (this.ignoreMutation) {
+ return;
+ }
+
+ this.handleMutation(oldValue, newValue);
+}
+
+// Called when a change that isn't ignored occurs to the attribute's value.
ExtensionViewAttribute.prototype.handleMutation =
function(oldValue, newValue) {};
@@ -76,9 +86,6 @@ SrcAttribute.prototype.setValueIgnoreMutation = function(value) {
}
SrcAttribute.prototype.handleMutation = function(oldValue, newValue) {
- if (this.attributes[attributeName].ignoreMutation)
- return;
-
if (!newValue && oldValue) {
this.setValueIgnoreMutation(oldValue);
return;
« no previous file with comments | « extensions/renderer/resources/guest_view/extension_view.js ('k') | extensions/renderer/resources/guest_view/web_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698