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

Side by Side Diff: extensions/renderer/resources/guest_view/web_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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This module implements the attributes of the <webview> tag. 5 // This module implements the attributes of the <webview> tag.
6 6
7 var GuestViewInternal = 7 var GuestViewInternal =
8 require('binding').Binding.create('guestViewInternal').generate(); 8 require('binding').Binding.create('guestViewInternal').generate();
9 var WebViewImpl = require('webView').WebViewImpl; 9 var WebViewImpl = require('webView').WebViewImpl;
10 var WebViewConstants = require('webViewConstants').WebViewConstants; 10 var WebViewConstants = require('webViewConstants').WebViewConstants;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return this.getValue(); 46 return this.getValue();
47 }.bind(this), 47 }.bind(this),
48 set: function(value) { 48 set: function(value) {
49 this.setValue(value); 49 this.setValue(value);
50 }.bind(this), 50 }.bind(this),
51 enumerable: true 51 enumerable: true
52 }); 52 });
53 }; 53 };
54 54
55 // Called when the attribute's value changes. 55 // Called when the attribute's value changes.
56 WebViewAttribute.prototype.maybeHandleMutation = function(oldValue, newValue) {
57 if (this.ignoreMutation) {
58 return;
59 }
60
61 this.handleMutation(oldValue, newValue);
62 };
63
64 // Called when a change that isn't ignored occurs to the attribute's value.
56 WebViewAttribute.prototype.handleMutation = function(oldValue, newValue) {}; 65 WebViewAttribute.prototype.handleMutation = function(oldValue, newValue) {};
57 66
58 // An attribute that is treated as a Boolean. 67 // An attribute that is treated as a Boolean.
59 function BooleanAttribute(name, webViewImpl) { 68 function BooleanAttribute(name, webViewImpl) {
60 WebViewAttribute.call(this, name, webViewImpl); 69 WebViewAttribute.call(this, name, webViewImpl);
61 } 70 }
62 71
63 BooleanAttribute.prototype.__proto__ = WebViewAttribute.prototype; 72 BooleanAttribute.prototype.__proto__ = WebViewAttribute.prototype;
64 73
65 BooleanAttribute.prototype.getValue = function() { 74 BooleanAttribute.prototype.getValue = function() {
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 284
276 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT, 285 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT,
277 WebViewConstants.ATTRIBUTE_MAXWIDTH, 286 WebViewConstants.ATTRIBUTE_MAXWIDTH,
278 WebViewConstants.ATTRIBUTE_MINHEIGHT, 287 WebViewConstants.ATTRIBUTE_MINHEIGHT,
279 WebViewConstants.ATTRIBUTE_MINWIDTH]; 288 WebViewConstants.ATTRIBUTE_MINWIDTH];
280 for (var i = 0; autosizeAttributes[i]; ++i) { 289 for (var i = 0; autosizeAttributes[i]; ++i) {
281 this.attributes[autosizeAttributes[i]] = 290 this.attributes[autosizeAttributes[i]] =
282 new AutosizeDimensionAttribute(autosizeAttributes[i], this); 291 new AutosizeDimensionAttribute(autosizeAttributes[i], this);
283 } 292 }
284 }; 293 };
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/web_view.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698