| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 params, | 69 params, |
| 70 function(instanceId) { | 70 function(instanceId) { |
| 71 if (instanceId == 0) { | 71 if (instanceId == 0) { |
| 72 // Fire a createfailed event here rather than in ExtensionOptionsGuest | 72 // Fire a createfailed event here rather than in ExtensionOptionsGuest |
| 73 // because the guest will not be created, and cannot fire an event. | 73 // because the guest will not be created, and cannot fire an event. |
| 74 this.initCalled = false; | 74 this.initCalled = false; |
| 75 var createFailedEvent = new Event('createfailed', { bubbles: true }); | 75 var createFailedEvent = new Event('createfailed', { bubbles: true }); |
| 76 this.dispatchEvent(createFailedEvent); | 76 this.dispatchEvent(createFailedEvent); |
| 77 } else { | 77 } else { |
| 78 this.attachWindow(instanceId); | 78 this.attachWindow(instanceId); |
| 79 GuestViewInternal.setAutoSize(this.instanceId, { | |
| 80 'enableAutoSize': | |
| 81 this.extensionoptionsNode.hasAttribute('autosize'), | |
| 82 'min': { | |
| 83 'width': parseInt(this.minwidth || 0), | |
| 84 'height': parseInt(this.minheight || 0) | |
| 85 }, | |
| 86 'max': { | |
| 87 'width': parseInt(this.maxwidth || 0), | |
| 88 'height': parseInt(this.maxheight || 0) | |
| 89 } | |
| 90 }); | |
| 91 } | 79 } |
| 92 }.bind(this)); | 80 }.bind(this)); |
| 93 }; | 81 }; |
| 94 | 82 |
| 95 ExtensionOptionsInternal.prototype.dispatchEvent = | 83 ExtensionOptionsInternal.prototype.dispatchEvent = |
| 96 function(extensionOptionsEvent) { | 84 function(extensionOptionsEvent) { |
| 97 return this.extensionoptionsNode.dispatchEvent(extensionOptionsEvent); | 85 return this.extensionoptionsNode.dispatchEvent(extensionOptionsEvent); |
| 98 }; | 86 }; |
| 99 | 87 |
| 100 ExtensionOptionsInternal.prototype.handleExtensionOptionsAttributeMutation = | 88 ExtensionOptionsInternal.prototype.handleExtensionOptionsAttributeMutation = |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 264 |
| 277 var useCapture = true; | 265 var useCapture = true; |
| 278 window.addEventListener('readystatechange', function listener(event) { | 266 window.addEventListener('readystatechange', function listener(event) { |
| 279 if (document.readyState == 'loading') | 267 if (document.readyState == 'loading') |
| 280 return; | 268 return; |
| 281 | 269 |
| 282 registerBrowserPluginElement(); | 270 registerBrowserPluginElement(); |
| 283 registerExtensionOptionsElement(); | 271 registerExtensionOptionsElement(); |
| 284 window.removeEventListener(event.type, listener, useCapture); | 272 window.removeEventListener(event.type, listener, useCapture); |
| 285 }, useCapture); | 273 }, useCapture); |
| OLD | NEW |