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

Settings > network > update input and dialog style

This CL fixes a number of inconsistencies with input style and
overall dialog appearance.

Bug: 832177,829272
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Icb5bdd4245073d3c8db5100ebc3bca1a8b4f1b17
Reviewed-on: https://chromium-review.googlesource.com/1091166
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarScott Chen <scottchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565643}
parent 87d70d4c
...@@ -143,6 +143,6 @@ Polymer({ ...@@ -143,6 +143,6 @@ Polymer({
/** @private */ /** @private */
onAllowSharedDialogClose_: function() { onAllowSharedDialogClose_: function() {
cr.ui.focusWithoutInk(assert(this.$$('#allowShared'))); this.$.allowShared.focus();
}, },
}); });
...@@ -9,10 +9,10 @@ js_type_check("closure_compile") { ...@@ -9,10 +9,10 @@ js_type_check("closure_compile") {
":network_apnlist", ":network_apnlist",
":network_choose_mobile", ":network_choose_mobile",
":network_config", ":network_config",
":network_config_input",
":network_config_select", ":network_config_select",
":network_ip_config", ":network_ip_config",
":network_nameservers", ":network_nameservers",
":network_password_input",
":network_property_list", ":network_property_list",
":network_proxy", ":network_proxy",
":network_proxy_exclusions", ":network_proxy_exclusions",
...@@ -48,12 +48,6 @@ js_library("network_config") { ...@@ -48,12 +48,6 @@ js_library("network_config") {
extra_sources = [ "$interfaces_path/networking_private_interface.js" ] extra_sources = [ "$interfaces_path/networking_private_interface.js" ]
} }
js_library("network_config_input") {
deps = [
"//ui/webui/resources/js:i18n_behavior",
]
}
js_library("network_config_select") { js_library("network_config_select") {
deps = [ deps = [
"//ui/webui/resources/js:assert", "//ui/webui/resources/js:assert",
...@@ -77,6 +71,12 @@ js_library("network_nameservers") { ...@@ -77,6 +71,12 @@ js_library("network_nameservers") {
] ]
} }
js_library("network_password_input") {
deps = [
"//ui/webui/resources/js:i18n_behavior",
]
}
js_library("network_property_list") { js_library("network_property_list") {
deps = [ deps = [
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types", "//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
...@@ -107,7 +107,6 @@ js_library("network_proxy_exclusions") { ...@@ -107,7 +107,6 @@ js_library("network_proxy_exclusions") {
js_library("network_siminfo") { js_library("network_siminfo") {
deps = [ deps = [
"//third_party/polymer/v1_0/components-chromium/paper-input:paper-input-extracted",
"//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types", "//ui/webui/resources/cr_elements/chromeos/network:cr_onc_types",
"//ui/webui/resources/js:assert", "//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior", "//ui/webui/resources/js:i18n_behavior",
......
...@@ -33,13 +33,6 @@ ...@@ -33,13 +33,6 @@
], ],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
}, },
{
'target_name': 'network_config_input',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{ {
'target_name': 'network_config_select', 'target_name': 'network_config_select',
'dependencies': [ 'dependencies': [
...@@ -66,6 +59,13 @@ ...@@ -66,6 +59,13 @@
], ],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
}, },
{
'target_name': 'network_password_input',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
],
'includes': ['../../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{ {
'target_name': 'network_property_list', 'target_name': 'network_property_list',
'dependencies': [ 'dependencies': [
...@@ -101,7 +101,6 @@ ...@@ -101,7 +101,6 @@
{ {
'target_name': 'network_siminfo', 'target_name': 'network_siminfo',
'dependencies': [ 'dependencies': [
'<(DEPTH)/third_party/polymer/v1_0/components-chromium/paper-input/compiled_resources2.gyp:paper-input-extracted',
'<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types', '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html"> <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.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-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_config_input.html"> <link rel="import" href="network_password_input.html">
<link rel="import" href="network_config_select.html"> <link rel="import" href="network_config_select.html">
<dom-module id="network-config"> <dom-module id="network-config">
...@@ -16,9 +17,9 @@ ...@@ -16,9 +17,9 @@
<!-- SSID (WiFi) --> <!-- SSID (WiFi) -->
<template is="dom-if" if="[[isType_(NetworkType_.WI_FI, type)]]" restamp> <template is="dom-if" if="[[isType_(NetworkType_.WI_FI, type)]]" restamp>
<network-config-input id="ssid" label="[[i18n('OncWiFi-SSID')]]" <cr-input id="ssid" label="[[i18n('OncWiFi-SSID')]]"
value="{{configProperties_.WiFi.SSID}}" disabled="[[hasGuid_(guid)]]"> value="{{configProperties_.WiFi.SSID}}" disabled="[[hasGuid_(guid)]]">
</network-config-input> </cr-input>
</template> </template>
<!-- Security (WiFi and Ethernet) --> <!-- Security (WiFi and Ethernet) -->
...@@ -34,51 +35,51 @@ ...@@ -34,51 +35,51 @@
<!-- Passphrase (WiFi) --> <!-- Passphrase (WiFi) -->
<template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]" <template is="dom-if" if="[[configRequiresPassphrase_(type, security_)]]"
restamp> restamp>
<network-config-input label="[[i18n('OncWiFi-Passphrase')]]" <network-password-input label="[[i18n('OncWiFi-Passphrase')]]"
value="{{configProperties_.WiFi.Passphrase}}" password> value="{{configProperties_.WiFi.Passphrase}}">
<iron-a11y-keys keys="enter" on-keys-pressed="connectIfConfigured_"> <iron-a11y-keys keys="enter" on-keys-pressed="connectIfConfigured_">
</iron-a11y-keys> </iron-a11y-keys>
</network-config-input> </network-password-input>
</template> </template>
<!-- VPN --> <!-- VPN -->
<template is="dom-if" if="[[showVpn_]]" restamp> <template is="dom-if" if="[[showVpn_]]" restamp>
<network-config-input label="[[i18n('OncVPN-Host')]]" <cr-input label="[[i18n('OncVPN-Host')]]"
value="{{configProperties_.VPN.Host}}"> value="{{configProperties_.VPN.Host}}">
</network-config-input> </cr-input>
<network-config-input label="[[i18n('OncName')]]" <cr-input label="[[i18n('OncName')]]"
value="{{configProperties_.Name}}" disabled="[[hasGuid_(guid)]]"> value="{{configProperties_.Name}}" disabled="[[hasGuid_(guid)]]">
</network-config-input> </cr-input>
<network-config-select id="outer" label="[[i18n('OncVPN-Type')]]" <network-config-select id="outer" label="[[i18n('OncVPN-Type')]]"
value="{{vpnType_}}" items="[[vpnTypeItems_]]" value="{{vpnType_}}" items="[[vpnTypeItems_]]"
onc-prefix="VPN.Type" disabled="[[hasGuid_(guid)]]"> onc-prefix="VPN.Type" disabled="[[hasGuid_(guid)]]">
</network-config-select> </network-config-select>
<template is="dom-if" if="[[!showVpn_.OpenVPN]]"> <template is="dom-if" if="[[!showVpn_.OpenVPN]]">
<network-config-input label="[[i18n('OncVPN-L2TP-Username')]]" <cr-input label="[[i18n('OncVPN-L2TP-Username')]]"
value="{{configProperties_.VPN.L2TP.Username}}"> value="{{configProperties_.VPN.L2TP.Username}}">
</network-config-input> </cr-input>
<network-config-input label="[[i18n('OncVPN-L2TP-Password')]]" <network-password-input label="[[i18n('OncVPN-L2TP-Password')]]"
value="{{configProperties_.VPN.L2TP.Password}}" password> value="{{configProperties_.VPN.L2TP.Password}}">
</network-config-input> </network-password-input>
<network-config-input label="[[i18n('OncVPN-IPsec-Group')]]" <cr-input label="[[i18n('OncVPN-IPsec-Group')]]"
value="{{configProperties_.VPN.IPsec.Group}}"> value="{{configProperties_.VPN.IPsec.Group}}">
</network-config-input> </cr-input>
<template is="dom-if" if="[[!showVpn_.Cert]]"> <template is="dom-if" if="[[!showVpn_.Cert]]">
<network-config-input label="[[i18n('OncVPN-IPsec-PSK')]]" <network-password-input label="[[i18n('OncVPN-IPsec-PSK')]]"
value="{{configProperties_.VPN.IPsec.PSK}}" password> value="{{configProperties_.VPN.IPsec.PSK}}">
</network-config-input> </network-password-input>
</template> </template>
</template> </template>
<template is="dom-if" if="[[showVpn_.OpenVPN]]"> <template is="dom-if" if="[[showVpn_.OpenVPN]]">
<network-config-input label="[[i18n('OncVPN-OpenVPN-Username')]]" <cr-input label="[[i18n('OncVPN-OpenVPN-Username')]]"
value="{{configProperties_.VPN.OpenVPN.Username}}"> value="{{configProperties_.VPN.OpenVPN.Username}}">
</network-config-input> </cr-input>
<network-config-input label="[[i18n('OncVPN-OpenVPN-Password')]]" <network-password-input label="[[i18n('OncVPN-OpenVPN-Password')]]"
value="{{configProperties_.VPN.OpenVPN.Password}}" password> value="{{configProperties_.VPN.OpenVPN.Password}}">
</network-config-input> </network-password-input>
<network-config-input label="[[i18n('OncVPN-OpenVPN-OTP')]]" <cr-input label="[[i18n('OncVPN-OpenVPN-OTP')]]"
value="{{configProperties_.VPN.OpenVPN.OTP}}"> value="{{configProperties_.VPN.OpenVPN.OTP}}">
</network-config-input> </cr-input>
</template> </template>
<template is="dom-if" if="[[showVpn_.Cert]]"> <template is="dom-if" if="[[showVpn_.Cert]]">
<network-config-select id="vpnServerCa" <network-config-select id="vpnServerCa"
...@@ -117,25 +118,24 @@ ...@@ -117,25 +118,24 @@
value="{{selectedServerCaHash_}}" items="[[serverCaCerts_]]" value="{{selectedServerCaHash_}}" items="[[serverCaCerts_]]"
hidden="[[!showEap_.ServerCA]]" cert-list> hidden="[[!showEap_.ServerCA]]" cert-list>
</network-config-select> </network-config-select>
<network-config-input label="[[i18n('OncEAP-SubjectMatch')]]" <cr-input label="[[i18n('OncEAP-SubjectMatch')]]"
value="{{eapProperties_.SubjectMatch}}" value="{{eapProperties_.SubjectMatch}}"
hidden="[[!showEap_.SubjectMatch]]"> hidden="[[!showEap_.SubjectMatch]]">
</network-config-input> </cr-input>
<network-config-select id="userCert" label="[[i18n('OncEAP-UserCert')]]" <network-config-select id="userCert" label="[[i18n('OncEAP-UserCert')]]"
value="{{selectedUserCertHash_}}" items="[[userCerts_]]" value="{{selectedUserCertHash_}}" items="[[userCerts_]]"
hidden="[[!showEap_.UserCert]]" cert-list> hidden="[[!showEap_.UserCert]]" cert-list>
</network-config-select> </network-config-select>
<network-config-input label="[[i18n('OncEAP-Identity')]]" <cr-input label="[[i18n('OncEAP-Identity')]]"
value="{{eapProperties_.Identity}}" hidden="[[!showEap_.Identity]]"> value="{{eapProperties_.Identity}}" hidden="[[!showEap_.Identity]]">
</network-config-input> </cr-input>
<network-config-input label="[[i18n('OncEAP-Password')]]" <network-password-input label="[[i18n('OncEAP-Password')]]"
value="{{eapProperties_.Password}}" hidden="[[!showEap_.Password]]" value="{{eapProperties_.Password}}" hidden="[[!showEap_.Password]]">
password> </network-password-input>
</network-config-input> <cr-input label="[[i18n('OncEAP-AnonymousIdentity')]]"
<network-config-input label="[[i18n('OncEAP-AnonymousIdentity')]]"
value="{{eapProperties_.AnonymousIdentity}}" value="{{eapProperties_.AnonymousIdentity}}"
hidden="[[!showEap_.AnonymousIdentity]]"> hidden="[[!showEap_.AnonymousIdentity]]">
</network-config-input> </cr-input>
<div class="property-box"> <div class="property-box">
<div id="eapSaveCredentialsLabel" class="start"> <div id="eapSaveCredentialsLabel" class="start">
[[i18n('networkConfigSaveCredentials')]] [[i18n('networkConfigSaveCredentials')]]
......
...@@ -405,7 +405,8 @@ Polymer({ ...@@ -405,7 +405,8 @@ Polymer({
focusFirstInput_: function() { focusFirstInput_: function() {
Polymer.dom.flush(); Polymer.dom.flush();
var e = this.$$( var e = this.$$(
'network-config-input:not([disabled]),' + 'cr-input:not([disabled]),' +
'network-password-input:not([disabled]),' +
'network-config-select:not([disabled])'); 'network-config-select:not([disabled])');
if (e) if (e)
e.focus(); e.focus();
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.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-icon-button/paper-icon-button-light.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-config-input">
<template>
<style include="network-shared">
paper-input-container {
--paper-input-container-color: var(--secondary-text-color);
--paper-input-container-focus-color: var(--secondary-text-color);
--paper-input-container-input-color: var(--primary-text-color);
flex: 1;
}
#iconDiv {
-webkit-margin-start: var(--cr-icon-button-margin-start);
justify-content: center;
width: var(--network-control-margin);
}
#iconDiv paper-icon-button-light {
margin: 0;
}
</style>
<div class="control-box">
<paper-input-container always-float-label>
<label id="label" slot="label">[[label]]</label>
<iron-input slot="input" bind-value="{{value}}">
<input tabindex="1" disabled="[[disabled]]" aria-label$="[[label]]"
value="{{value::input}}"
type="[[getInputType_(password, showPassword)]]">
</iron-input>
</paper-input-container>
<div id="iconDiv">
<template is="dom-if" if="[[password]]">
<paper-icon-button-light class$="[[getIconClass_(showPassword)]]">
<button on-tap="onShowPasswordTap_"
title="[[getShowPasswordTitle_(showPassword)]]">
</button>
</paper-icon-button-light>
</template>
</div>
</div>
</template>
<script src="network_config_input.js"></script>
</dom-module>
...@@ -5,25 +5,26 @@ ...@@ -5,25 +5,26 @@
<dom-module id="network-config-select"> <dom-module id="network-config-select">
<template> <template>
<style include="network-shared md-select"> <style include="network-shared md-select">
#label {
color: var(--secondary-text-color);
}
.md-select { .md-select {
color: var(--primary-text-color); color: var(--primary-text-color);
width: 100%; width: 100%;
} }
.control-box { #label {
-webkit-padding-end: calc(var(--network-control-margin) + @apply --cr-form-field-label;
var(--cr-icon-button-margin-start)); }
#outer {
align-items: stretch; align-items: stretch;
display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
margin-bottom: var(--cr-form-field-bottom-spacing);
padding: 0;
} }
</style> </style>
<div class="control-box"> <div id="outer">
<div id="label">[[label]]</div> <div id="label">[[label]]</div>
<select class="md-select" disabled="[[disabled]]" <select class="md-select" disabled="[[disabled]]"
value="{{value::change}}" aria-label$="[[label]]"> value="{{value::change}}" aria-label$="[[label]]">
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<template is="dom-if" if="[[hasIpConfigFields_(ipConfig_)]]"> <template is="dom-if" if="[[hasIpConfigFields_(ipConfig_)]]">
<div class="property-box single-column indented stretch"> <div class="property-box single-column indented stretch">
<network-property-list <network-property-list editable
fields="[[ipConfigFields_]]" property-dict="[[ipConfig_]]" fields="[[ipConfigFields_]]" property-dict="[[ipConfig_]]"
edit-field-types="[[getIPEditFields_(editable, automatic_)]]" edit-field-types="[[getIPEditFields_(editable, automatic_)]]"
on-property-change="onIPChange_"> on-property-change="onIPChange_">
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html"> <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.html"> <link rel="import" href="chrome://resources/cr_elements/cr_radio_button/cr_radio_button.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-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/paper-input/paper-input-container.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
...@@ -17,10 +16,10 @@ ...@@ -17,10 +16,10 @@
-webkit-margin-start: 4px; -webkit-margin-start: 4px;
} }
paper-input-container { cr-input {
/* Aligns with the start of cr-radio-button's text. */ /* Aligns with the start of cr-radio-button's text. */
-webkit-margin-start: 38px; -webkit-margin-start: 38px;
height: 36px; margin-bottom: 4px;
} }
paper-radio-group { paper-radio-group {
...@@ -85,12 +84,10 @@ ...@@ -85,12 +84,10 @@
'custom')]]"> 'custom')]]">
<div class="property-box single-column two-line"> <div class="property-box single-column two-line">
<template is="dom-repeat" items="[[nameservers_]]"> <template is="dom-repeat" items="[[nameservers_]]">
<paper-input-container no-label-float> <cr-input id="nameserver[[index]]" value="[[item]]"
<iron-input slot="input" bind-value="[[item]]"> on-change="onValueChange_"
<input id="nameserver[[index]]" on-change="onValueChange_" disabled="[[!canEdit_(editable, nameserversType_)]]">
disabled="[[!canEdit_(editable, nameserversType_)]]"> </cr-input>
</iron-input>
</paper-input-container>
</template> </template>
</div> </div>
</template> </template>
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_icons_css.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="network_shared_css.html">
<dom-module id="network-password-input">
<template>
<style include="network-shared">
cr-input {
width: 100%;
}
paper-icon-button-light {
margin: 0;
width: var(--network-control-margin);
}
</style>
<cr-input label="[[label]]" value="{{value}}" disabled="[[disabled]]"
type="[[getInputType_(showPassword)]]">
<paper-icon-button-light id="icon" slot="suffix"
class$="[[getIconClass_(showPassword)]]">
<button on-tap="onShowPasswordTap_"
title="[[getShowPasswordTitle_(showPassword)]]">
</button>
</paper-icon-button-light>
</cr-input>
</template>
<script src="network_password_input.js"></script>
</dom-module>
...@@ -3,15 +3,18 @@ ...@@ -3,15 +3,18 @@
// found in the LICENSE file. // found in the LICENSE file.
/** /**
* @fileoverview Polymer element for network configuration input fields. * @fileoverview Polymer element for network password input fields.
*/ */
Polymer({ Polymer({
is: 'network-config-input', is: 'network-password-input',
behaviors: [I18nBehavior], behaviors: [I18nBehavior],
properties: { properties: {
label: String, label: {
type: String,
reflectToAttribute: true,
},
disabled: { disabled: {
type: Boolean, type: Boolean,
...@@ -23,8 +26,6 @@ Polymer({ ...@@ -23,8 +26,6 @@ Polymer({
notify: true, notify: true,
}, },
password: Boolean,
showPassword: { showPassword: {
type: Boolean, type: Boolean,
value: false, value: false,
...@@ -32,7 +33,7 @@ Polymer({ ...@@ -32,7 +33,7 @@ Polymer({
}, },
focus: function() { focus: function() {
this.$$('input').focus(); this.$$('cr-input').focus();
}, },
/** /**
...@@ -40,7 +41,7 @@ Polymer({ ...@@ -40,7 +41,7 @@ Polymer({
* @private * @private
*/ */
getInputType_: function() { getInputType_: function() {
return (this.password && !this.showPassword) ? 'password' : 'text'; return this.showPassword ? 'text' : 'password';
}, },
/** /**
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html"> <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_indicator.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-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/paper-input/paper-input-container.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
<dom-module id="network-property-list"> <dom-module id="network-property-list">
...@@ -17,6 +16,10 @@ ...@@ -17,6 +16,10 @@
padding: 0; padding: 0;
} }
cr-input[readonly] {
--cr-input-background: transparent;
}
cr-policy-network-indicator { cr-policy-network-indicator {
-webkit-margin-start: var(--settings-controlled-by-spacing); -webkit-margin-start: var(--settings-controlled-by-spacing);
} }
...@@ -28,7 +31,7 @@ ...@@ -28,7 +31,7 @@
<div class="layout horizontal center"> <div class="layout horizontal center">
<div>[[getPropertyLabel_(item, prefix)]]</div> <div>[[getPropertyLabel_(item, prefix)]]</div>
<template is="dom-if" restamp <template is="dom-if" restamp
if="[[isEditTypeAny_(item, editFieldTypes)]]"> if="[[isEditType_(item, editFieldTypes)]]">
<cr-policy-network-indicator <cr-policy-network-indicator
property="[[getProperty_(item, propertyDict)]]"> property="[[getProperty_(item, propertyDict)]]">
</cr-policy-network-indicator> </cr-policy-network-indicator>
...@@ -36,23 +39,21 @@ ...@@ -36,23 +39,21 @@
</div> </div>
<!-- Uneditable property value --> <!-- Uneditable property value -->
<template is="dom-if" restamp <template is="dom-if" restamp
if="[[!isEditable_(item, propertyDict, editFieldTypes)]]"> if="[[!showEditable_(item, propertyDict, editFieldTypes)]]">
<div class="secondary"> <div class="secondary">
[[getPropertyValue_(item, prefix, propertyDict)]] [[getPropertyValue_(item, prefix, propertyDict)]]
</div> </div>
</template> </template>
<!-- Editable String property value --> <!-- Editable property value -->
<template is="dom-if" restamp <template is="dom-if" restamp
if="[[isEditTypeInput_(item, propertyDict, editFieldTypes)]]"> if="[[showEditable_(item, propertyDict, editFieldTypes)]]">
<paper-input-container no-label-float> <cr-input id="[[item]]"
<iron-input slot="input" readonly="[[!isEditable_(item, propertyDict, editFieldTypes)]]"
bind-value="[[getPropertyValue_(item, prefix, propertyDict)]]"> value="[[getPropertyValue_(item, prefix, propertyDict)]]"
<input id="[[item]]" on-change="onValueChange_" on-change="onValueChange_"
type="[[getEditInputType_(item, editFieldTypes)]]"> type="[[getEditInputType_(item, editFieldTypes)]]">
</iron-input> </cr-input>
</paper-input-container>
</template> </template>
<!-- TODO(stevenjb): Support other types (number, boolean)? -->
</div> </div>
</template> </template>
</template> </template>
......
...@@ -13,6 +13,16 @@ Polymer({ ...@@ -13,6 +13,16 @@ Polymer({
behaviors: [I18nBehavior, CrPolicyNetworkBehavior], behaviors: [I18nBehavior, CrPolicyNetworkBehavior],
properties: { properties: {
/**
* If true, all fields are shown as editable. Fields without an edit type
* or that are policy enforced will be shown as 'readonly'. Used for lists
* with dynamic edit types (e.g. network-ip-config).
*/
editable: {
type: Boolean,
value: false,
},
/** /**
* The dictionary containing the properties to display. * The dictionary containing the properties to display.
* @type {!Object|undefined} * @type {!Object|undefined}
...@@ -38,7 +48,6 @@ Polymer({ ...@@ -38,7 +48,6 @@ Polymer({
* separated list of strings. * separated list of strings.
* 'Password' - A string with input type = password. * 'Password' - A string with input type = password.
* TODO(stevenjb): Support types with custom validation, e.g. IPAddress. * TODO(stevenjb): Support types with custom validation, e.g. IPAddress.
* TODO(stevenjb): Support 'Number'.
* When a field changes, the 'property-change' event will be fired with * When a field changes, the 'property-change' event will be fired with
* the field name and the new value provided in the event detail. * the field name and the new value provided in the event detail.
*/ */
...@@ -140,11 +149,13 @@ Polymer({ ...@@ -140,11 +149,13 @@ Polymer({
/** /**
* @param {string} key The property key. * @param {string} key The property key.
* @param {!Object} editFieldTypes * @param {!Object} editFieldTypes
* @return {boolean} * @return {boolean} True if the edit type for the key is a valid type.
* @private * @private
*/ */
isEditTypeAny_: function(key, editFieldTypes) { isEditType_: function(key, editFieldTypes) {
return editFieldTypes[key] !== undefined; var editType = editFieldTypes[key];
return editType == 'String' || editType == 'StringArray' ||
editType == 'Password';
}, },
/** /**
...@@ -154,35 +165,30 @@ Polymer({ ...@@ -154,35 +165,30 @@ Polymer({
* @return {boolean} * @return {boolean}
* @private * @private
*/ */
isEditTypeInput_: function(key, propertyDict, editFieldTypes) { isEditable_: function(key, propertyDict, editFieldTypes) {
if (!this.isPropertyEditable_(key, propertyDict)) return this.isEditType_(key, editFieldTypes) &&
return false; this.isPropertyEditable_(key, propertyDict);
var editType = editFieldTypes[key];
return editType == 'String' || editType == 'StringArray' ||
editType == 'Password';
}, },
/** /**
* @param {string} key The property key. * @param {string} key The property key.
* @param {!Object} propertyDict
* @param {!Object} editFieldTypes * @param {!Object} editFieldTypes
* @return {string} * @return {boolean}
* @private * @private
*/ */
getEditInputType_: function(key, editFieldTypes) { showEditable_: function(key, propertyDict, editFieldTypes) {
return editFieldTypes[key] == 'Password' ? 'password' : 'text'; return this.isEditable_(key, propertyDict, editFieldTypes) || this.editable;
}, },
/** /**
* @param {string} key The property key. * @param {string} key The property key.
* @param {!Object} propertyDict
* @param {!Object} editFieldTypes * @param {!Object} editFieldTypes
* @return {boolean} * @return {string}
* @private * @private
*/ */
isEditable_: function(key, propertyDict, editFieldTypes) { getEditInputType_: function(key, editFieldTypes) {
if (!this.isPropertyEditable_(key, propertyDict)) return editFieldTypes[key] == 'Password' ? 'password' : 'text';
return false;
return this.isEditTypeAny_(key, editFieldTypes);
}, },
/** /**
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.html"> <link rel="import" href="chrome://resources/cr_elements/chromeos/network/cr_onc_types.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/cr_elements/hidden_style_css.html"> <link rel="import" href="chrome://resources/cr_elements/hidden_style_css.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html"> <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network_behavior.html">
...@@ -11,8 +12,6 @@ ...@@ -11,8 +12,6 @@
<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">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
<link rel="import" href="network_proxy_exclusions.html"> <link rel="import" href="network_proxy_exclusions.html">
<link rel="import" href="network_proxy_input.html"> <link rel="import" href="network_proxy_input.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
...@@ -28,6 +27,14 @@ ...@@ -28,6 +27,14 @@
margin: 10px 0; margin: 10px 0;
} }
#addException {
margin-top: 8px;
}
#addException cr-input {
margin-bottom: 0;
}
#manualProxy { #manualProxy {
-webkit-padding-start: var(--cr-section-padding); -webkit-padding-start: var(--cr-section-padding);
} }
...@@ -50,12 +57,12 @@ ...@@ -50,12 +57,12 @@
<!-- Autoconfiguration (PAC) --> <!-- Autoconfiguration (PAC) -->
<div class="property-box indented" <div class="property-box indented"
hidden$="[[!matches_(proxy_.Type, ProxySettingsType_.PAC)]]"> hidden$="[[!matches_(proxy_.Type, ProxySettingsType_.PAC)]]">
<div>[[i18n('networkProxyAutoConfig')]]</div> <cr-input id="pacInput" class="flex"
<paper-input id="pacInput" no-label-float class="middle" label="[[i18n('networkProxyAutoConfig')]]"
value="{{proxy_.PAC}}" on-change="onPACChange_" value="{{proxy_.PAC}}" on-change="onPACChange_"
disabled="[[!isEditable_('PAC', networkProperties, editable, disabled="[[!isEditable_('PAC', networkProperties, editable,
useSharedProxies)]]"> useSharedProxies)]]">
</paper-input> </cr-input>
</div> </div>
<!-- Web Proxy Auto Discovery (WPAD) --> <!-- Web Proxy Auto Discovery (WPAD) -->
...@@ -128,15 +135,12 @@ ...@@ -128,15 +135,12 @@
editable="[[isEditable_('ExcludeDomains', networkProperties, editable="[[isEditable_('ExcludeDomains', networkProperties,
editable, useSharedProxies)]]"> editable, useSharedProxies)]]">
</network-proxy-exclusions> </network-proxy-exclusions>
<div class="layout horizontal"> <div id="addException" class="layout horizontal center">
<paper-input-container no-label-float class="flex"> <cr-input id="proxyExclusion" class="flex">
<iron-input slot="input"> <iron-a11y-keys keys="enter"
<input id="proxyExclusion">
</iron-input>
<iron-a11y-keys keys="enter" slot="add-on"
on-keys-pressed="onAddProxyExclusionTap_"> on-keys-pressed="onAddProxyExclusionTap_">
</iron-a11y-keys> </iron-a11y-keys>
</paper-input-container> </cr-input>
<paper-button on-tap="onAddProxyExclusionTap_"> <paper-button on-tap="onAddProxyExclusionTap_">
[[i18n('networkProxyAddException')]] [[i18n('networkProxyAddException')]]
</paper-button> </paper-button>
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_input/cr_input.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-input/iron-input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input-container.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
<dom-module id="network-proxy-input"> <dom-module id="network-proxy-input">
<template> <template>
<style include="network-shared"> <style include="network-shared">
paper-input-container { cr-input {
-webkit-margin-start: 10px; margin: 0 var(--cr-button-edge-spacing);
} }
#container { #container {
...@@ -33,17 +32,13 @@ ...@@ -33,17 +32,13 @@
</style> </style>
<div id="container"> <div id="container">
<div id="label">[[label]]</div> <div id="label">[[label]]</div>
<paper-input-container id="host" no-label-float disabled$="[[!editable]]"> <cr-input id="host" readonly="[[!editable]]" value="{{value.Host}}"
<iron-input slot="input" bind-value="{{value.Host}}"> on-change="onValueChange_">
<input disabled$="[[!editable]]" on-change="onValueChange_"> </cr-input>
</iron-input>
</paper-input-container>
<div>[[i18n('networkProxyPort')]]</div> <div>[[i18n('networkProxyPort')]]</div>
<paper-input-container id="port" no-label-float disabled$="[[!editable]]"> <cr-input id="port" readonly="[[!editable]]" value="{{value.Port}}"
<iron-input slot="input" bind-value="{{value.Port}}"> on-change="onValueChange_">
<input disabled$="[[!editable]]" on-change="onValueChange_"> </cr-input>
</iron-input>
</paper-input-container>
</div> </div>
</template> </template>
<script src="network_proxy_input.js"></script> <script src="network_proxy_input.js"></script>
......
...@@ -44,7 +44,7 @@ Polymer({ ...@@ -44,7 +44,7 @@ Polymer({
}, },
focus: function() { focus: function() {
this.$$('input').focus(); this.$$('cr-input').focus();
}, },
/** /**
......
...@@ -10,13 +10,6 @@ ...@@ -10,13 +10,6 @@
--network-control-margin: 40px; --network-control-margin: 40px;
} }
.control-box {
align-items: center;
display: flex;
height: 58px; /* Matches height of paper-input */
padding: 0;
}
.property-box { .property-box {
@apply --cr-section; @apply --cr-section;
border-top: none; border-top: none;
...@@ -61,23 +54,9 @@ ...@@ -61,23 +54,9 @@
@apply --cr-secondary-text; @apply --cr-secondary-text;
} }
paper-input-container { cr-input {
--paper-input-container-input: { --cr-input-error-display: none;
color: var(--paper-grey-600); margin-bottom: var(--cr-form-field-bottom-spacing);
font-size: inherit;
font-weight: 400;
};
--paper-input-container-input-color: var(--secondary-text-color);
margin-bottom: -12px;
margin-top: -10px;
width: 250px;
}
iron-input input {
@apply --paper-input-container-shared-input-style;
@apply --cr-secondary-text;
font-size: inherit;
line-height: inherit;
} }
</style> </style>
</template> </template>
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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">
<link rel="import" href="network_config_input.html"> <link rel="import" href="network_password_input.html">
<link rel="import" href="network_shared_css.html"> <link rel="import" href="network_shared_css.html">
<dom-module id="network-siminfo"> <dom-module id="network-siminfo">
...@@ -95,16 +95,19 @@ ...@@ -95,16 +95,19 @@
on-close="onEnterPinDialogClose_"> on-close="onEnterPinDialogClose_">
<div slot="title">[[i18n('networkSimEnterPinTitle')]]</div> <div slot="title">[[i18n('networkSimEnterPinTitle')]]</div>
<div slot="body"> <div slot="body">
<network-config-input id="enterPin" password <network-password-input id="enterPin"
label="[[i18n('networkSimEnterPin')]]"> label="[[i18n('networkSimEnterPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendEnterPin_"> <iron-a11y-keys keys="enter" on-keys-pressed="sendEnterPin_">
</iron-a11y-keys> </iron-a11y-keys>
</network-config-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
</div> </div>
</div> </div>
<div slot="button-container"> <div slot="button-container">
<paper-button class="cancel-button" on-tap="closeDialogs_">
[[i18n('cancel')]]
</paper-button>
<paper-button on-tap="sendEnterPin_" disabled="[[inProgress_]]"> <paper-button on-tap="sendEnterPin_" disabled="[[inProgress_]]">
[[i18n('networkSimEnter')]] [[i18n('networkSimEnter')]]
</paper-button> </paper-button>
...@@ -116,22 +119,25 @@ ...@@ -116,22 +119,25 @@
on-close="onChangePinDialogClose_"> on-close="onChangePinDialogClose_">
<div slot="title">[[i18n('networkSimChangePinTitle')]]</div> <div slot="title">[[i18n('networkSimChangePinTitle')]]</div>
<div slot="body"> <div slot="body">
<network-config-input id="changePinOld" password <network-password-input id="changePinOld"
label="[[i18n('networkSimEnterOldPin')]]"> label="[[i18n('networkSimEnterOldPin')]]">
</network-config-input> </network-password-input>
<network-config-input id="changePinNew1" password <network-password-input id="changePinNew1"
label="[[i18n('networkSimEnterNewPin')]]"> label="[[i18n('networkSimEnterNewPin')]]">
</network-config-input> </network-password-input>
<network-config-input id="changePinNew2" password <network-password-input id="changePinNew2"
label="[[i18n('networkSimReEnterNewPin')]]"> label="[[i18n('networkSimReEnterNewPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendChangePin_"> <iron-a11y-keys keys="enter" on-keys-pressed="sendChangePin_">
</iron-a11y-keys> </iron-a11y-keys>
</network-config-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
</div> </div>
</div> </div>
<div slot="button-container"> <div slot="button-container">
<paper-button class="cancel-button" on-tap="closeDialogs_">
[[i18n('cancel')]]
</paper-button>
<paper-button class="action-button" on-tap="sendChangePin_" <paper-button class="action-button" on-tap="sendChangePin_"
disabled="[[inProgress_]]"> disabled="[[inProgress_]]">
[[i18n('networkSimChange')]] [[i18n('networkSimChange')]]
...@@ -144,16 +150,19 @@ ...@@ -144,16 +150,19 @@
on-close="onUnlockPinDialogClose_"> on-close="onUnlockPinDialogClose_">
<div slot="title">[[i18n('networkSimLockedTitle')]]</div> <div slot="title">[[i18n('networkSimLockedTitle')]]</div>
<div slot="body"> <div slot="body">
<network-config-input id="unlockPin" password <network-password-input id="unlockPin"
label="[[i18n('networkSimEnterPin')]]"> label="[[i18n('networkSimEnterPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPin_"> <iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPin_">
</iron-a11y-keys> </iron-a11y-keys>
</network-config-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[getErrorMsg_(error_, networkProperties)]] [[getErrorMsg_(error_, networkProperties)]]
</div> </div>
</div> </div>
<div slot="button-container"> <div slot="button-container">
<paper-button class="cancel-button" on-tap="closeDialogs_">
[[i18n('cancel')]]
</paper-button>
<paper-button on-tap="sendUnlockPin_" disabled="[[inProgress_]]"> <paper-button on-tap="sendUnlockPin_" disabled="[[inProgress_]]">
[[i18n('networkSimUnlock')]] [[i18n('networkSimUnlock')]]
</paper-button> </paper-button>
...@@ -168,17 +177,17 @@ ...@@ -168,17 +177,17 @@
<div> <div>
Enter the 8-digit PIN Unblocking Key provided by your carrier Enter the 8-digit PIN Unblocking Key provided by your carrier
</div> </div>
<network-config-input id="unlockPuk" password <network-password-input id="unlockPuk"
label="[[i18n('networkSimEnterPuk')]]"> label="[[i18n('networkSimEnterPuk')]]">
</network-config-input> </network-password-input>
<network-config-input id="unlockPin1" password <network-password-input id="unlockPin1"
label="[[i18n('networkSimEnterNewPin')]]"> label="[[i18n('networkSimEnterNewPin')]]">
</network-config-input> </network-password-input>
<network-config-input id="unlockPin2" password <network-password-input id="unlockPin2"
label="[[i18n('networkSimReEnterNewPin')]]"> label="[[i18n('networkSimReEnterNewPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPuk_"> <iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPuk_">
</iron-a11y-keys> </iron-a11y-keys>
</network-config-input> </network-password-input>
<div class="dialog-error"> <div class="dialog-error">
[[i18n('networkSimLockedWarning')]] [[i18n('networkSimLockedWarning')]]
</div> </div>
...@@ -187,6 +196,9 @@ ...@@ -187,6 +196,9 @@
</div> </div>
</div> </div>
<div slot="button-container"> <div slot="button-container">
<paper-button class="cancel-button" on-tap="closeDialogs_">
[[i18n('cancel')]]
</paper-button>
<paper-button on-tap="sendUnlockPuk_" disabled="[[inProgress_]]"> <paper-button on-tap="sendUnlockPuk_" disabled="[[inProgress_]]">
[[i18n('networkSimUnlock')]] [[i18n('networkSimUnlock')]]
</paper-button> </paper-button>
......
...@@ -90,8 +90,15 @@ Polymer({ ...@@ -90,8 +90,15 @@ Polymer({
/** @override */ /** @override */
detached: function() { detached: function() {
if (this.$.enterPinDialog.open) this.closeDialogs_();
},
/** @private */
closeDialogs_: function() {
if (this.$.enterPinDialog.open) {
this.onEnterPinDialogCancel_();
this.$.enterPinDialog.close(); this.$.enterPinDialog.close();
}
if (this.$.changePinDialog.open) if (this.$.changePinDialog.open)
this.$.changePinDialog.close(); this.$.changePinDialog.close();
if (this.$.unlockPinDialog.open) if (this.$.unlockPinDialog.open)
...@@ -215,7 +222,7 @@ Polymer({ ...@@ -215,7 +222,7 @@ Polymer({
this.inProgress_ = false; this.inProgress_ = false;
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN; this.error_ = ErrorType.INCORRECT_PIN;
this.$.enterPin.inputElement.select(); this.$.enterPin.focus();
} else { } else {
this.error_ = ErrorType.NONE; this.error_ = ErrorType.NONE;
this.$.enterPinDialog.close(); this.$.enterPinDialog.close();
...@@ -265,7 +272,7 @@ Polymer({ ...@@ -265,7 +272,7 @@ Polymer({
this.inProgress_ = false; this.inProgress_ = false;
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN; this.error_ = ErrorType.INCORRECT_PIN;
this.$.changePinOld.inputElement.select(); this.$.changePinOld.focus();
} else { } else {
this.error_ = ErrorType.NONE; this.error_ = ErrorType.NONE;
this.$.changePinDialog.close(); this.$.changePinDialog.close();
...@@ -305,7 +312,7 @@ Polymer({ ...@@ -305,7 +312,7 @@ Polymer({
this.inProgress_ = false; this.inProgress_ = false;
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN; this.error_ = ErrorType.INCORRECT_PIN;
this.$.unlockPin.inputElement.select(); this.$.unlockPin.focus();
} else { } else {
this.error_ = ErrorType.NONE; this.error_ = ErrorType.NONE;
this.$.unlockPinDialog.close(); this.$.unlockPinDialog.close();
...@@ -356,7 +363,7 @@ Polymer({ ...@@ -356,7 +363,7 @@ Polymer({
this.inProgress_ = false; this.inProgress_ = false;
if (chrome.runtime.lastError) { if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PUK; this.error_ = ErrorType.INCORRECT_PUK;
this.$.unlockPuk.inputElement.select(); this.$.unlockPuk.focus();
} else { } else {
this.error_ = ErrorType.NONE; this.error_ = ErrorType.NONE;
this.$.unlockPukDialog.close(); this.$.unlockPukDialog.close();
......
...@@ -131,14 +131,6 @@ ...@@ -131,14 +131,6 @@
file="cr_components/chromeos/network/network_config.js" file="cr_components/chromeos/network/network_config.js"
type="chrome_html" type="chrome_html"
compress="gzip" /> compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS__NETWORK_CONFIG_INPUT_HTML"
file="cr_components/chromeos/network/network_config_input.html"
type="chrome_html"
compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS__NETWORK_CONFIG_INPUT_JS"
file="cr_components/chromeos/network/network_config_input.js"
type="chrome_html"
compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS__NETWORK_CONFIG_SELECT_HTML" <structure name="IDR_WEBUI_CHROMEOS__NETWORK_CONFIG_SELECT_HTML"
file="cr_components/chromeos/network/network_config_select.html" file="cr_components/chromeos/network/network_config_select.html"
type="chrome_html" type="chrome_html"
...@@ -163,6 +155,14 @@ ...@@ -163,6 +155,14 @@
file="cr_components/chromeos/network/network_nameservers.js" file="cr_components/chromeos/network/network_nameservers.js"
type="chrome_html" type="chrome_html"
compress="gzip" /> compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS__NETWORK_PASSWORD_INPUT_HTML"
file="cr_components/chromeos/network/network_password_input.html"
type="chrome_html"
compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS__NETWORK_PASSWORD_INPUT_JS"
file="cr_components/chromeos/network/network_password_input.js"
type="chrome_html"
compress="gzip" />
<structure name="IDR_WEBUI_CHROMEOS_NETWORK_PROPERTY_LIST_HTML" <structure name="IDR_WEBUI_CHROMEOS_NETWORK_PROPERTY_LIST_HTML"
file="cr_components/chromeos/network/network_property_list.html" file="cr_components/chromeos/network/network_property_list.html"
type="chrome_html" type="chrome_html"
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
*/ */
:host { :host {
--cr-input-background: var(--google-grey-refresh-100);
--cr-input-error-color: var(--google-red-600); --cr-input-error-color: var(--google-red-600);
--cr-input-focus-color: var(--google-blue-600); --cr-input-focus-color: var(--google-blue-600);
display: block; display: block;
...@@ -60,7 +61,7 @@ ...@@ -60,7 +61,7 @@
input { input {
-webkit-appearance: none; -webkit-appearance: none;
background: var(--google-grey-refresh-100); background: var(--cr-input-background);
border: none; border: none;
box-sizing: border-box; box-sizing: border-box;
caret-color: var(--cr-input-focus-color); caret-color: var(--cr-input-focus-color);
......
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