Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / resources / chromeos / login / gaia_input_form.js
bloba49348b27cca7b62bd9cbf300b29df796378a800
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 Polymer({
6 is: 'gaia-input-form',
8 properties: {
9 disabled: {
10 type: Boolean,
11 observer: 'onDisabledChanged_',
14 buttonText: String
17 onButtonClicked_: function() {
18 this.fire('submit');
21 getInputs_: function() {
22 return Polymer.dom(this.$.inputs).getDistributedNodes();
25 onKeyDown_: function(e) {
26 if (e.keyCode != 13 || this.$.button.disabled)
27 return;
28 if (this.getInputs_().indexOf(e.target) == -1)
29 return;
30 this.onButtonClicked_();
33 getControls_: function() {
34 var controls = this.getInputs_();
35 controls.push(this.$.button);
36 return controls.concat(Polymer.dom(this).querySelectorAll('gaia-button'));
39 onDisabledChanged_: function(disabled) {
40 this.getControls_().forEach(function(control) {
41 control.disabled = disabled;
42 });
44 });