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

Side by Side Diff: extensions/renderer/resources/guest_view/web_view_attributes.js

Issue 847893002: Implemented explicit resizing from guestview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another small fix. Created 5 years, 11 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
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 AutosizeDimensionAttribute.prototype.getValue = function() { 102 AutosizeDimensionAttribute.prototype.getValue = function() {
103 return parseInt(this.webViewImpl.element.getAttribute(this.name)) || 0; 103 return parseInt(this.webViewImpl.element.getAttribute(this.name)) || 0;
104 }; 104 };
105 105
106 AutosizeDimensionAttribute.prototype.handleMutation = function( 106 AutosizeDimensionAttribute.prototype.handleMutation = function(
107 oldValue, newValue) { 107 oldValue, newValue) {
108 if (!this.webViewImpl.guest.getId()) { 108 if (!this.webViewImpl.guest.getId()) {
109 return; 109 return;
110 } 110 }
111 this.webViewImpl.guest.setAutoSize({ 111 this.webViewImpl.guest.setSize({
112 'enableAutoSize': this.webViewImpl.attributes[ 112 'enableAutoSize': this.webViewImpl.attributes[
113 WebViewConstants.ATTRIBUTE_AUTOSIZE].getValue(), 113 WebViewConstants.ATTRIBUTE_AUTOSIZE].getValue(),
114 'min': { 114 'min': {
115 'width': this.webViewImpl.attributes[ 115 'width': this.webViewImpl.attributes[
116 WebViewConstants.ATTRIBUTE_MINWIDTH].getValue(), 116 WebViewConstants.ATTRIBUTE_MINWIDTH].getValue(),
117 'height': this.webViewImpl.attributes[ 117 'height': this.webViewImpl.attributes[
118 WebViewConstants.ATTRIBUTE_MINHEIGHT].getValue() 118 WebViewConstants.ATTRIBUTE_MINHEIGHT].getValue()
119 }, 119 },
120 'max': { 120 'max': {
121 'width': this.webViewImpl.attributes[ 121 'width': this.webViewImpl.attributes[
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT, 276 var autosizeAttributes = [WebViewConstants.ATTRIBUTE_MAXHEIGHT,
277 WebViewConstants.ATTRIBUTE_MAXWIDTH, 277 WebViewConstants.ATTRIBUTE_MAXWIDTH,
278 WebViewConstants.ATTRIBUTE_MINHEIGHT, 278 WebViewConstants.ATTRIBUTE_MINHEIGHT,
279 WebViewConstants.ATTRIBUTE_MINWIDTH]; 279 WebViewConstants.ATTRIBUTE_MINWIDTH];
280 for (var i = 0; autosizeAttributes[i]; ++i) { 280 for (var i = 0; autosizeAttributes[i]; ++i) {
281 this.attributes[autosizeAttributes[i]] = 281 this.attributes[autosizeAttributes[i]] =
282 new AutosizeDimensionAttribute(autosizeAttributes[i], this); 282 new AutosizeDimensionAttribute(autosizeAttributes[i], this);
283 } 283 }
284 }; 284 };
OLDNEW
« no previous file with comments | « extensions/renderer/resources/guest_view/guest_view_container.js ('k') | extensions/test/data/web_view/apitest/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698