OLD | NEW |
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 GuestViewInternal = | 8 var GuestViewInternal = |
9 require('binding').Binding.create('guestViewInternal').generate(); | 9 require('binding').Binding.create('guestViewInternal').generate(); |
10 var IdGenerator = requireNative('id_generator'); | 10 var IdGenerator = requireNative('id_generator'); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 this.browserPluginNode.style.height = newHeight + 'px'; | 168 this.browserPluginNode.style.height = newHeight + 'px'; |
169 | 169 |
170 // Do not allow the options page's dimensions to shrink so that the options | 170 // Do not allow the options page's dimensions to shrink so that the options |
171 // page has a consistent UI. If the new size is larger than the minimum, | 171 // page has a consistent UI. If the new size is larger than the minimum, |
172 // make that the new minimum size. | 172 // make that the new minimum size. |
173 if (newWidth > this.minwidth) | 173 if (newWidth > this.minwidth) |
174 this.minwidth = newWidth; | 174 this.minwidth = newWidth; |
175 if (newHeight > this.minheight) | 175 if (newHeight > this.minheight) |
176 this.minheight = newHeight; | 176 this.minheight = newHeight; |
177 | 177 |
178 GuestViewInternal.setAutoSize(this.instanceId, { | 178 GuestViewInternal.setAutoSize(this.guestInstanceId, { |
179 'enableAutoSize': this.extensionoptionsNode.hasAttribute('autosize'), | 179 'enableAutoSize': this.extensionoptionsNode.hasAttribute('autosize'), |
180 'min': { | 180 'min': { |
181 'width': parseInt(this.minwidth || 0), | 181 'width': parseInt(this.minwidth || 0), |
182 'height': parseInt(this.minheight || 0) | 182 'height': parseInt(this.minheight || 0) |
183 }, | 183 }, |
184 'max': { | 184 'max': { |
185 'width': parseInt(this.maxwidth || 0), | 185 'width': parseInt(this.maxwidth || 0), |
186 'height': parseInt(this.maxheight || 0) | 186 'height': parseInt(this.maxheight || 0) |
187 } | 187 } |
188 }); | 188 }); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 349 |
350 var useCapture = true; | 350 var useCapture = true; |
351 window.addEventListener('readystatechange', function listener(event) { | 351 window.addEventListener('readystatechange', function listener(event) { |
352 if (document.readyState == 'loading') | 352 if (document.readyState == 'loading') |
353 return; | 353 return; |
354 | 354 |
355 registerBrowserPluginElement(); | 355 registerBrowserPluginElement(); |
356 registerExtensionOptionsElement(); | 356 registerExtensionOptionsElement(); |
357 window.removeEventListener(event.type, listener, useCapture); | 357 window.removeEventListener(event.type, listener, useCapture); |
358 }, useCapture); | 358 }, useCapture); |
OLD | NEW |