Chromium Code Reviews| Index: extensions/renderer/resources/guest_view/extension_options/extension_options.js |
| diff --git a/extensions/renderer/resources/guest_view/extension_options/extension_options.js b/extensions/renderer/resources/guest_view/extension_options/extension_options.js |
| index 0a92096d23c33dd23ca84f864442e14ef1b364fd..8a854535e5275afdac8220a309907f51f7ffbfee 100644 |
| --- a/extensions/renderer/resources/guest_view/extension_options/extension_options.js |
| +++ b/extensions/renderer/resources/guest_view/extension_options/extension_options.js |
| @@ -2,16 +2,16 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +var ExtensionOptionsConstants = |
| + require('extensionOptionsConstants').ExtensionOptionsConstants; |
| var ExtensionOptionsEvents = |
| require('extensionOptionsEvents').ExtensionOptionsEvents; |
| -var GuestView = require('guestView').GuestView; |
| var GuestViewContainer = require('guestViewContainer').GuestViewContainer; |
| function ExtensionOptionsImpl(extensionoptionsElement) { |
| GuestViewContainer.call(this, extensionoptionsElement, 'extensionoptions'); |
| new ExtensionOptionsEvents(this); |
| - this.setupElementProperties(); |
| }; |
| ExtensionOptionsImpl.prototype.__proto__ = GuestViewContainer.prototype; |
| @@ -24,7 +24,8 @@ ExtensionOptionsImpl.prototype.onElementAttached = function() { |
| ExtensionOptionsImpl.prototype.buildContainerParams = function() { |
| return { |
| - 'extensionId': this.element.getAttribute('extension') |
| + 'extensionId': this.attributes[ |
|
Fady Samuel
2015/03/20 19:53:57
Can we simply iterate over the attributes array he
paulmeyer
2015/03/24 17:31:42
Done.
|
| + ExtensionOptionsConstants.ATTRIBUTE_EXTENSION].getValue() |
| }; |
| }; |
| @@ -48,31 +49,7 @@ ExtensionOptionsImpl.prototype.createGuest = function() { |
| }.bind(this)); |
| }; |
| -ExtensionOptionsImpl.prototype.handleAttributeMutation = |
| - function(name, oldValue, newValue) { |
| - // We treat null attribute (attribute removed) and the empty string as |
| - // one case. |
| - oldValue = oldValue || ''; |
| - newValue = newValue || ''; |
| - |
| - if (oldValue === newValue) |
| - return; |
| - |
| - if (name == 'extension') { |
| - this.createGuest(); |
| - } |
| -}; |
| - |
| -ExtensionOptionsImpl.prototype.setupElementProperties = function() { |
| - $Object.defineProperty(this.element, 'extension', { |
| - get: function() { |
| - return this.element.getAttribute('extension'); |
| - }.bind(this), |
| - set: function(value) { |
| - this.element.setAttribute('extension', value); |
| - }.bind(this), |
| - enumerable: true |
| - }); |
| -}; |
| - |
| GuestViewContainer.registerElement(ExtensionOptionsImpl); |
| + |
| +// Exports. |
| +exports.ExtensionOptionsImpl = ExtensionOptionsImpl; |