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

Side by Side Diff: chrome/renderer/resources/extensions/extension_options.js

Issue 455063002: Fix autosize related bugs in <extensionoptions> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « chrome/browser/guest_view/extension_options/extension_options_guest.cc ('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 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
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
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);
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/extension_options/extension_options_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698