Commit d5d388e5 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Settings > Network: Remove incorrect use of iron-a11y-keys

iron-a11y-keys is not scoped, i.e. it is global within a
component, so it is not a good choice for complex components.

Bug: 827953
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I65ce312f3476a85d75b2f806ecd5fac7ec70fe12
Reviewed-on: https://chromium-review.googlesource.com/1100311Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567379}
parent 49602f04
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html"> <link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html"> <link rel="import" href="chrome://resources/cr_elements/cr_toggle/cr_toggle.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
<link rel="import" href="network_password_input.html"> <link rel="import" href="network_password_input.html">
...@@ -36,9 +35,8 @@ ...@@ -36,9 +35,8 @@
<template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]" <template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]"
restamp> restamp>
<network-password-input label="[[i18n('OncWiFi-Passphrase')]]" <network-password-input label="[[i18n('OncWiFi-Passphrase')]]"
value="{{configProperties_.WiFi.Passphrase}}"> value="{{configProperties_.WiFi.Passphrase}}"
<iron-a11y-keys keys="enter" on-keys-pressed="connectIfConfigured_"> on-enter="connectIfConfigured_">
</iron-a11y-keys>
</network-password-input> </network-password-input>
</template> </template>
......
...@@ -18,8 +18,9 @@ ...@@ -18,8 +18,9 @@
} }
</style> </style>
<cr-input label="[[label]]" value="{{value}}" disabled="[[disabled]]" <cr-input id="input" label="[[label]]" value="{{value}}"
type="[[getInputType_(showPassword)]]"> disabled="[[disabled]]" type="[[getInputType_(showPassword)]]"
on-keypress="onInputKeypress_">
<paper-icon-button-light id="icon" slot="suffix" <paper-icon-button-light id="icon" slot="suffix"
class$="[[getIconClass_(showPassword)]]"> class$="[[getIconClass_(showPassword)]]">
<button on-tap="onShowPasswordTap_" <button on-tap="onShowPasswordTap_"
......
...@@ -61,8 +61,23 @@ Polymer({ ...@@ -61,8 +61,23 @@ Polymer({
this.i18n('showPassword'); this.i18n('showPassword');
}, },
/** @private */ /**
onShowPasswordTap_: function() { * @param {!Event} event
* @private
*/
onShowPasswordTap_: function(event) {
this.showPassword = !this.showPassword; this.showPassword = !this.showPassword;
event.stopPropagation();
},
/**
* @param {!Event} event
* @private
*/
onInputKeypress_: function(event) {
if (event.target.id != 'input' || event.key != 'Enter')
return;
event.stopPropagation();
this.fire('enter');
}, },
}); });
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
<link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/md_select_css.html"> <link rel="import" href="chrome://resources/html/md_select_css.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
...@@ -133,13 +132,11 @@ ...@@ -133,13 +132,11 @@
editable, useSharedProxies)]]"> editable, useSharedProxies)]]">
</network-proxy-exclusions> </network-proxy-exclusions>
<div id="addException" class="layout horizontal center"> <div id="addException" class="layout horizontal center">
<cr-input id="proxyExclusion" class="flex"> <cr-input id="proxyExclusion" class="flex"
on-keypress="onAddProxyExclusionKeypress_">
<paper-button on-tap="onAddProxyExclusionTap_" slot="suffix"> <paper-button on-tap="onAddProxyExclusionTap_" slot="suffix">
[[i18n('networkProxyAddException')]] [[i18n('networkProxyAddException')]]
</paper-button> </paper-button>
<iron-a11y-keys keys="enter"
on-keys-pressed="onAddProxyExclusionTap_">
</iron-a11y-keys>
</cr-input> </cr-input>
</div> </div>
</div> </div>
......
...@@ -344,12 +344,8 @@ Polymer({ ...@@ -344,12 +344,8 @@ Polymer({
this.proxyIsUserModified_ = true; this.proxyIsUserModified_ = true;
}, },
/** /** @private */
* Event triggered when a proxy exclusion is added. onAddProxyExclusionTap_: function() {
* @param {!Event} event The add proxy exclusion event.
* @private
*/
onAddProxyExclusionTap_: function(event) {
var value = this.$.proxyExclusion.value; var value = this.$.proxyExclusion.value;
if (!value) if (!value)
return; return;
...@@ -359,6 +355,17 @@ Polymer({ ...@@ -359,6 +355,17 @@ Polymer({
this.proxyIsUserModified_ = true; this.proxyIsUserModified_ = true;
}, },
/**
* @param {!Event} event
* @private
*/
onAddProxyExclusionKeypress_: function(event) {
if (event.key != 'Enter')
return;
event.stopPropagation();
this.onAddProxyExclusionTap_();
},
/** /**
* Event triggered when the proxy exclusion list changes. * Event triggered when the proxy exclusion list changes.
* @param {!Event} event The remove proxy exclusions change event. * @param {!Event} event The remove proxy exclusions change event.
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<link rel="import" href="chrome://resources/html/assert.html"> <link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html"> <link rel="import" href="chrome://resources/html/cr/ui/focus_without_ink.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-a11y-keys/iron-a11y-keys.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
...@@ -96,9 +95,7 @@ ...@@ -96,9 +95,7 @@
<div slot="title">[[i18n('networkSimEnterPinTitle')]]</div> <div slot="title">[[i18n('networkSimEnterPinTitle')]]</div>
<div slot="body"> <div slot="body">
<network-password-input id="enterPin" value="{{pin_}}" <network-password-input id="enterPin" value="{{pin_}}"
label="[[i18n('networkSimEnterPin')]]"> label="[[i18n('networkSimEnterPin')]]" on-enter="sendEnterPin_">
<iron-a11y-keys keys="enter" on-keys-pressed="sendEnterPin_">
</iron-a11y-keys>
</network-password-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
...@@ -127,9 +124,8 @@ ...@@ -127,9 +124,8 @@
label="[[i18n('networkSimEnterNewPin')]]"> label="[[i18n('networkSimEnterNewPin')]]">
</network-password-input> </network-password-input>
<network-password-input id="changePinNew2" value="{{pin_new2_}}" <network-password-input id="changePinNew2" value="{{pin_new2_}}"
label="[[i18n('networkSimReEnterNewPin')]]"> label="[[i18n('networkSimReEnterNewPin')]]"
<iron-a11y-keys keys="enter" on-keys-pressed="sendChangePin_"> on-enter="sendChangePin_">
</iron-a11y-keys>
</network-password-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
...@@ -152,9 +148,7 @@ ...@@ -152,9 +148,7 @@
<div slot="title">[[i18n('networkSimLockedTitle')]]</div> <div slot="title">[[i18n('networkSimLockedTitle')]]</div>
<div slot="body"> <div slot="body">
<network-password-input id="unlockPin" value="{{pin_}}" <network-password-input id="unlockPin" value="{{pin_}}"
label="[[i18n('networkSimEnterPin')]]"> label="[[i18n('networkSimEnterPin')]]" on-enter="sendUnlockPin_">
<iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPin_">
</iron-a11y-keys>
</network-password-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
...@@ -186,9 +180,8 @@ ...@@ -186,9 +180,8 @@
label="[[i18n('networkSimEnterNewPin')]]"> label="[[i18n('networkSimEnterNewPin')]]">
</network-password-input> </network-password-input>
<network-password-input id="unlockPin2" value="{{pin_new2_}}" <network-password-input id="unlockPin2" value="{{pin_new2_}}"
label="[[i18n('networkSimReEnterNewPin')]]"> label="[[i18n('networkSimReEnterNewPin')]]"
<iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPuk_"> on-enter="sendUnlockPuk_">
</iron-a11y-keys>
</network-password-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[i18n('networkSimLockedWarning')]] [[i18n('networkSimLockedWarning')]]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment