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

Side by Side Diff: chrome/renderer/resources/extensions/extension_options.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
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | 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 var DocumentNatives = requireNative('document_natives'); 5 var DocumentNatives = requireNative('document_natives');
6 var ExtensionOptionsEvents = 6 var ExtensionOptionsEvents =
7 require('extensionOptionsEvents').ExtensionOptionsEvents; 7 require('extensionOptionsEvents').ExtensionOptionsEvents;
8 var GuestView = require('guestView').GuestView; 8 var GuestView = require('guestView').GuestView;
9 var GuestViewContainer = require('guestViewContainer').GuestViewContainer; 9 var GuestViewContainer = require('guestViewContainer').GuestViewContainer;
10 var GuestViewInternal = 10 var GuestViewInternal =
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 // TODO(ericzeng): Implement navigation to another guest view if we want 122 // TODO(ericzeng): Implement navigation to another guest view if we want
123 // that functionality. 123 // that functionality.
124 } else if (AUTO_SIZE_ATTRIBUTES.hasOwnProperty(name) > -1) { 124 } else if (AUTO_SIZE_ATTRIBUTES.hasOwnProperty(name) > -1) {
125 this[name] = newValue; 125 this[name] = newValue;
126 this.resetSizeConstraintsIfInvalid(); 126 this.resetSizeConstraintsIfInvalid();
127 127
128 if (!this.guest.getId()) 128 if (!this.guest.getId())
129 return; 129 return;
130 130
131 this.guest.setAutoSize({ 131 this.guest.setSize({
132 'enableAutoSize': this.element.hasAttribute('autosize'), 132 'enableAutoSize': this.element.hasAttribute('autosize'),
133 'min': { 133 'min': {
134 'width': parseInt(this.minwidth || 0), 134 'width': parseInt(this.minwidth || 0),
135 'height': parseInt(this.minheight || 0) 135 'height': parseInt(this.minheight || 0)
136 }, 136 },
137 'max': { 137 'max': {
138 'width': parseInt(this.maxwidth || 0), 138 'width': parseInt(this.maxwidth || 0),
139 'height': parseInt(this.maxheight || 0) 139 'height': parseInt(this.maxheight || 0)
140 } 140 }
141 }); 141 });
(...skipping 28 matching lines...) Expand all
170 this.element.style.height = newHeight + 'px'; 170 this.element.style.height = newHeight + 'px';
171 171
172 // Do not allow the options page's dimensions to shrink. This ensures that the 172 // Do not allow the options page's dimensions to shrink. This ensures that the
173 // options page has a consistent UI. If the new size is larger than the 173 // options page has a consistent UI. If the new size is larger than the
174 // minimum, make that the new minimum size. 174 // minimum, make that the new minimum size.
175 if (newWidth > this.minwidth) 175 if (newWidth > this.minwidth)
176 this.minwidth = newWidth; 176 this.minwidth = newWidth;
177 if (newHeight > this.minheight) 177 if (newHeight > this.minheight)
178 this.minheight = newHeight; 178 this.minheight = newHeight;
179 179
180 this.guest.setAutoSize({ 180 this.guest.setSize({
181 'enableAutoSize': this.element.hasAttribute('autosize'), 181 'enableAutoSize': this.element.hasAttribute('autosize'),
182 'min': { 182 'min': {
183 'width': parseInt(this.minwidth || 0), 183 'width': parseInt(this.minwidth || 0),
184 'height': parseInt(this.minheight || 0) 184 'height': parseInt(this.minheight || 0)
185 }, 185 },
186 'max': { 186 'max': {
187 'width': parseInt(this.maxwidth || 0), 187 'width': parseInt(this.maxwidth || 0),
188 'height': parseInt(this.maxheight || 0) 188 'height': parseInt(this.maxheight || 0)
189 } 189 }
190 }); 190 });
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 ExtensionOptionsImpl.prototype.resumeDeferredAutoSize = function() { 279 ExtensionOptionsImpl.prototype.resumeDeferredAutoSize = function() {
280 if (this.autosizeDeferred) { 280 if (this.autosizeDeferred) {
281 this.resize(this.deferredAutoSizeState.newWidth, 281 this.resize(this.deferredAutoSizeState.newWidth,
282 this.deferredAutoSizeState.newHeight, 282 this.deferredAutoSizeState.newHeight,
283 this.deferredAutoSizeState.oldWidth, 283 this.deferredAutoSizeState.oldWidth,
284 this.deferredAutoSizeState.oldHeight); 284 this.deferredAutoSizeState.oldHeight);
285 } 285 }
286 }; 286 };
287 287
288 GuestViewContainer.registerElement(ExtensionOptionsImpl); 288 GuestViewContainer.registerElement(ExtensionOptionsImpl);
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/platform_apps/web_view/shim/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698