Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <link rel="import" href="chrome://resources/html/polymer.html"> | 1 <link rel="import" href="chrome://resources/html/polymer.html"> |
| 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-coll apse.html"> | 2 <link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-coll apse.html"> |
| 3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> | 3 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classe s/iron-flex-layout.html"> |
| 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> | 4 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-butt on.html"> |
| 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-ch eckbox.html"> | 5 <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-ch eckbox.html"> |
| 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> | 6 <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper -icon-button.html"> |
| 7 <link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expa nd_button.html"> | 7 <link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expa nd_button.html"> |
| 8 <link rel="import" href="chrome://resources/cr_elements/icons.html"> | 8 <link rel="import" href="chrome://resources/cr_elements/icons.html"> |
| 9 <link rel="import" href="chrome://resources/cr_elements/network/cr_network_icon. html"> | 9 <link rel="import" href="chrome://resources/cr_elements/network/cr_network_icon. html"> |
| 10 <link rel="import" href="chrome://resources/cr_elements/network/cr_onc_types.htm l"> | 10 <link rel="import" href="chrome://resources/cr_elements/network/cr_onc_types.htm l"> |
| 11 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network _behavior.html"> | 11 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network _behavior.html"> |
| 12 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network _indicator.html"> | 12 <link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_network _indicator.html"> |
| 13 <link rel="import" href="/settings_shared_css.html"> | 13 <link rel="import" href="/settings_shared_css.html"> |
| 14 <link rel="import" href="network_apnlist.html"> | 14 <link rel="import" href="network_apnlist.html"> |
| 15 <link rel="import" href="network_ip_config.html"> | 15 <link rel="import" href="network_ip_config.html"> |
| 16 <link rel="import" href="network_nameservers.html"> | 16 <link rel="import" href="network_nameservers.html"> |
| 17 <link rel="import" href="network_property_list.html"> | 17 <link rel="import" href="network_property_list.html"> |
| 18 <link rel="import" href="network_proxy.html"> | 18 <link rel="import" href="network_proxy.html"> |
| 19 <link rel="import" href="network_siminfo.html"> | 19 <link rel="import" href="network_siminfo.html"> |
| 20 | 20 |
| 21 <dom-module id="settings-internet-detail-page"> | 21 <dom-module id="settings-internet-detail-page"> |
| 22 <template> | 22 <template> |
| 23 <style include="settings-shared"> | 23 <style include="settings-shared"> |
| 24 .section { | |
| 25 margin-bottom: 5px; | |
| 26 } | |
| 27 | |
| 28 iron-collapse { | 24 iron-collapse { |
| 29 margin: 10px; | 25 margin: 10px; |
| 30 } | 26 } |
| 31 | 27 |
| 32 cr-network-icon { | 28 cr-network-icon { |
| 29 -webkit-margin-end: 20px; | |
| 33 height: 32px; | 30 height: 32px; |
| 34 width: 32px; | 31 width: 32px; |
| 35 } | 32 } |
| 36 | 33 |
| 37 cr-policy-network-indicator { | 34 cr-policy-network-indicator { |
| 38 -webkit-margin-start: 10px; | 35 -webkit-margin-start: 10px; |
| 39 } | 36 } |
| 40 | 37 |
| 41 #networkName, | 38 div.indented { |
| 42 #networkState { | 39 -webkit-margin-start: 20px; |
| 43 -webkit-margin-start: 10px; | 40 } |
| 44 font-size: 20px; | 41 |
| 42 .settings-box.embedded { | |
| 43 align-self: stretch; | |
| 44 border-top: none; | |
| 45 padding: 0; | |
| 46 } | |
| 47 | |
| 48 div.subtitle { | |
| 49 font-weight: 500; | |
| 50 padding: 20px 0; | |
| 51 } | |
| 52 | |
| 53 #titleDiv paper-button { | |
| 54 margin: 10px 0; | |
| 45 } | 55 } |
| 46 | 56 |
| 47 #networkName { | 57 #networkName { |
| 48 font-weight: bold; | 58 font-size: 100%; |
| 59 font-weight: 500; | |
| 49 } | 60 } |
| 50 | 61 |
| 62 #networkState { | |
| 63 @apply(--settings-secondary); | |
| 64 font-size: 80%; | |
| 65 } | |
| 66 | |
| 51 #networkState[connected] { | 67 #networkState[connected] { |
| 52 color: green; | 68 color: var(--google-green-500); |
| 53 } | |
| 54 | |
| 55 #outerDiv { | |
| 56 margin: 10px 20px; | |
| 57 } | |
| 58 | |
| 59 #ipAddressLabel { | |
| 60 -webkit-margin-end: 10px; | |
| 61 font-weight: bold; | |
| 62 } | |
| 63 | |
| 64 #preferButton { | |
| 65 -webkit-margin-end: 8px; | |
| 66 -webkit-margin-start: -3px; | |
| 67 padding: 0 | |
| 68 } | 69 } |
| 69 | 70 |
| 70 #proxyDiv { | 71 #proxyDiv { |
| 71 max-width: 500px; | 72 max-width: 500px; |
| 72 } | 73 } |
| 73 </style> | 74 </style> |
| 74 <div class="layout vertical"> | 75 <div class="settings-box first layout vertical"> |
|
dschuyler
2016/07/26 01:18:23
nit: Is layout vertical necessary?
stevenjb
2016/07/26 16:47:17
flex-direction defaults to 'row'. I can use the ne
| |
| 75 <!-- Title section: Icon + name + connection state. --> | 76 <!-- Title section: Icon + name + connection state. --> |
| 76 <div id="titleDiv" class="layout horizontal center"> | 77 <div id="titleDiv" class="layout horizontal center self-stretch"> |
| 77 <cr-network-icon network-state="[[networkProperties]]"> | 78 <div class="start layout horizontal center"> |
|
dschuyler
2016/07/26 01:18:23
nit: Is layout horizontal center necessary?
The i
stevenjb
2016/07/26 16:47:17
Changed to 'settings-box embedded'
(I don't think
| |
| 78 </cr-network-icon> | 79 <cr-network-icon network-state="[[networkProperties]]"> |
| 79 <span id="networkName">[[getStateName_(networkProperties)]]</span> | 80 </cr-network-icon> |
| 80 <span id="networkState" | 81 <div class="layout vertical"> |
| 81 connected$="[[isConnectedState_(networkProperties)]]" | 82 <span id="networkName">[[getStateName_(networkProperties)]]</span> |
| 82 >[[getStateText_(networkProperties)]]</span> | 83 <span id="networkState" |
| 83 </div> | 84 connected$="[[isConnectedState_(networkProperties)]]"> |
| 84 | 85 [[getStateText_(networkProperties)]] |
| 85 <div id="outerDiv" class="layout vertical"> | |
| 86 <!-- For Cellular, show SIM info first. --> | |
| 87 <div class="layout vertical section"> | |
| 88 <network-siminfo editable | |
| 89 hidden$="[[!showCellularSim_(networkProperties)]]" | |
| 90 network-properties="[[networkProperties]]" | |
| 91 on-siminfo-change="onNetworkPropertyChange_" | |
| 92 networking-private="[[networkingPrivate]]"> | |
| 93 </network-siminfo> | |
| 94 </div> | |
| 95 | |
| 96 <!-- Info and properties common to all networks. --> | |
| 97 <div class="layout vertical"> | |
| 98 <div class="layout horizontal section" hidden$="[[!IPAddress]]"> | |
| 99 <span id="ipAddressLabel">IP Address:</span> | |
| 100 <span>[[IPAddress]]</span> | |
| 101 </div> | |
| 102 <div class="section"> | |
| 103 <span hidden$="[[!showShared_(networkProperties)]]"> | |
| 104 This network is shared with other users. | |
| 105 </span> | 86 </span> |
| 106 </div> | 87 </div> |
| 107 <div class="layout horizontal center section" | |
| 108 hidden$="[[!showPreferNetwork_(networkProperties)]]"> | |
| 109 <paper-icon-button id="preferButton" toggles | |
| 110 active="{{preferNetwork}}" | |
| 111 disabled= | |
| 112 "[[isNetworkPolicyEnforced(networkProperties.Priority)]]" | |
| 113 icon="[[getPreferredIcon_(preferNetwork)]]"> | |
| 114 </paper-icon-button> | |
| 115 <span>Prefer this network</span> | |
| 116 <cr-policy-network-indicator | |
| 117 property="[[networkProperties.Priority]]"> | |
| 118 </cr-policy-network-indicator> | |
| 119 </div> | |
| 120 <div class="layout horizontal center section" | |
| 121 hidden$="[[!showAutoConnect_(networkProperties)]]"> | |
| 122 <paper-checkbox checked="{{autoConnect}}"> | |
| 123 Automatically connect to this network | |
| 124 </paper-checkbox> | |
| 125 <cr-policy-network-indicator | |
| 126 property="[[getManagedAutoConnect_(networkProperties)]]"> | |
| 127 </cr-policy-network-indicator> | |
| 128 </div> | |
| 129 <!-- Properties to always show if present. --> | |
| 130 <div class="section"> | |
| 131 <network-property-list | |
| 132 fields="[[getInfoFields_(networkProperties)]]" | |
| 133 property-dict="[[networkProperties]]"> | |
| 134 </network-property-list> | |
| 135 </div> | |
| 136 </div> | 88 </div> |
| 137 | 89 <div class="layout horizontal center"> |
| 138 <!-- Button row: Advanced + Disconnect | Connect. --> | 90 <paper-button class="secondary-button" on-tap="onViewAccountTap_" |
| 139 <div id="buttonDiv" class="layout horizontal center"> | 91 hidden$="[[!showViewAccount_(networkProperties)]]"> |
| 140 <paper-button toggles noink active="{{advancedExpanded}}" | |
| 141 hidden$="[[!hasAdvancedOrDeviceFields_(networkProperties)]]"> | |
| 142 Advanced | |
| 143 </paper-button> | |
| 144 <span class="flex"></span> | |
| 145 <paper-button hidden$="[[!showViewAccount_(networkProperties)]]" | |
| 146 on-tap="onViewAccountTap_"> | |
| 147 View Account | 92 View Account |
| 148 </paper-button> | 93 </paper-button> |
| 149 <paper-button hidden$="[[!showActivate_(networkProperties)]]" | 94 <paper-button class="secondary-button" on-tap="onActivateTap_" |
| 150 on-tap="onActivateTap_"> | 95 hidden$="[[!showActivate_(networkProperties)]]"> |
| 151 Activate | 96 Activate |
| 152 </paper-button> | 97 </paper-button> |
| 153 <paper-button hidden$="[[!showConnect_(networkProperties)]]" | 98 <paper-button class="primary-button" on-tap="onConnectTap_" |
| 154 disabled="[[!enableConnect_(networkProperties, defaultNetwork)]]" | 99 hidden$="[[!showConnect_(networkProperties)]]" |
| 155 on-tap="onConnectTap_"> | 100 disabled="[[!enableConnect_(networkProperties, defaultNetwork)]]"> |
| 156 Connect | 101 Connect |
| 157 </paper-button> | 102 </paper-button> |
| 158 <paper-button hidden$="[[!showDisconnect_(networkProperties)]]" | 103 <paper-button class="primary-button" on-tap="onDisconnectTap_" |
| 159 on-tap="onDisconnectTap_"> | 104 hidden$="[[!showDisconnect_(networkProperties)]]"> |
| 160 Disconnect | 105 Disconnect |
| 161 </paper-button> | 106 </paper-button> |
| 162 </div> | 107 </div> |
| 108 </div> | |
| 109 <!-- Shared. --> | |
| 110 <div class="settings-box embedded" | |
| 111 hidden$="[[!showShared_(networkProperties)]]"> | |
| 112 This network is shared with other users. | |
|
dschuyler
2016/07/26 01:18:23
Question:
Do these in-lined strings need i18n?
I
stevenjb
2016/07/26 16:47:17
Yes and yes.
| |
| 113 </div> | |
| 114 <!-- Prefer this network. --> | |
| 115 <div class="settings-box embedded" | |
| 116 hidden$="[[!showPreferNetwork_(networkProperties)]]"> | |
| 117 <paper-checkbox checked="{{preferNetwork}}" | |
| 118 disabled="[[isNetworkPolicyEnforced(networkProperties.Priority)]]"> | |
| 119 Prefer this network | |
| 120 </paper-checkbox> | |
| 121 <cr-policy-network-indicator property="[[networkProperties.Priority]]"> | |
| 122 </cr-policy-network-indicator> | |
| 123 </div> | |
| 124 <!-- Autoconnect. --> | |
| 125 <div class="settings-box embedded" | |
| 126 hidden$="[[!showAutoConnect_(networkProperties)]]"> | |
| 127 <paper-checkbox checked="{{autoConnect}}"> | |
| 128 Automatically connect to this network | |
| 129 </paper-checkbox> | |
| 130 <cr-policy-network-indicator | |
| 131 property="[[getManagedAutoConnect_(networkProperties)]]"> | |
| 132 </cr-policy-network-indicator> | |
| 133 </div> | |
| 134 </div> | |
| 163 | 135 |
| 164 <!-- Advanced section --> | 136 <!-- SIM Info (Cellular only). --> |
| 165 <div id="advancedDiv" class="layout vertical" | 137 <div class="settings-box self-stretch" |
| 166 hidden$="[[!hasAdvancedOrDeviceFields_(networkProperties)]]"> | 138 hidden$="[[!showCellularSim_(networkProperties)]]"> |
| 167 <iron-collapse opened="[[advancedExpanded]]"> | 139 <network-siminfo editable network-properties="[[networkProperties]]" |
| 168 <!-- Advanced properties --> | 140 on-siminfo-change="onNetworkPropertyChange_" |
| 169 <div id="advancedInfoDiv" class="layout vertical section"> | 141 networking-private="[[networkingPrivate]]"> |
| 170 <network-property-list | 142 </network-siminfo> |
| 171 fields="[[getAdvancedFields_(networkProperties)]]" | 143 </div> |
| 172 property-dict="[[networkProperties]]"> | |
| 173 </network-property-list> | |
| 174 </div> | |
| 175 | 144 |
| 176 <!-- Network (APN, address, nameservers) --> | 145 <!-- IP Address. --> |
| 177 <div id="addressDiv" class="layout vertical section" | 146 <div class="settings-box two-line single-column" hidden$="[[!IPAddress]]"> |
| 178 hidden$="[[!hasNetworkSection_(networkProperties)]]"> | 147 <div>IP Address</div> |
| 179 <div> | 148 <div class="secondary">[[IPAddress]]</div> |
| 180 <paper-button toggles noink active="{{addressExpanded}}"> | 149 </div> |
| 181 Network | |
| 182 </paper-button> | |
| 183 </div> | |
| 184 <iron-collapse opened="[[addressExpanded]]"> | |
| 185 <div class="layout vertical"> | |
| 186 <network-apnlist editable | |
| 187 hidden$="[[!isType_(networkProperties, NetworkType.CELLULA R)]]" | |
| 188 network-properties="[[networkProperties]]" | |
| 189 on-apn-change="onNetworkPropertyChange_"> | |
| 190 </network-apnlist> | |
| 191 <network-ip-config editable | |
| 192 network-properties="[[networkProperties]]" | |
| 193 on-ip-change="onIPConfigChange_"> | |
| 194 </network-ip-config> | |
| 195 <network-nameservers editable | |
| 196 network-properties="[[networkProperties]]" | |
| 197 on-nameservers-change="onIPConfigChange_"> | |
| 198 </network-nameservers> | |
| 199 </div> | |
| 200 </iron-collapse> | |
| 201 </div> | |
| 202 | 150 |
| 203 <!-- Proxy --> | 151 <!-- Properties to always show if present. --> |
| 204 <div class="layout vertical section" | 152 <network-property-list hidden$="[[!hasInfoFields_(networkProperties)]]" |
| 205 hidden$="[[!hasNetworkSection_(networkProperties)]]"> | 153 fields="[[getInfoFields_(networkProperties)]]" |
| 206 <div> | 154 property-dict="[[networkProperties]]"> |
| 207 <paper-button toggles noink active="{{proxyExpanded}}"> | 155 </network-property-list> |
| 208 Proxy | |
| 209 </paper-button> | |
| 210 </div> | |
| 211 <iron-collapse opened="[[proxyExpanded]]"> | |
| 212 <div id="proxyDiv" class="layout vertical"> | |
| 213 <network-proxy editable | |
| 214 network-properties="[[networkProperties]]" | |
| 215 on-proxy-change="onProxyChange_"> | |
| 216 </network-proxy> | |
| 217 </div> | |
| 218 </iron-collapse> | |
| 219 </div> | |
| 220 | 156 |
| 221 <!-- Device properties --> | 157 <!-- Advanced toggle. --> |
| 222 <div class="layout vertical section" | 158 <div class="settings-box" actionable on-tap="toggleAdvancedExpanded_" |
| 223 hidden$="[[!hasDeviceFields_(networkProperties)]]"> | 159 hidden$="[[!hasAdvancedOrDeviceFields_(networkProperties)]]"> |
| 224 <div> | 160 <div class="start">Advanced</div> |
| 225 <paper-button toggles noink active="{{deviceExpanded}}"> | 161 <cr-expand-button id="expandButton" expanded="{{advancedExpanded}}"> |
| 226 Device | 162 </cr-expand-button> |
| 227 </paper-button> | 163 </div> |
| 228 </div> | 164 |
| 229 <iron-collapse opened="[[deviceExpanded]]"> | 165 <!-- Advanced section --> |
| 230 <network-property-list | 166 <iron-collapse opened="[[advancedExpanded]]"> |
| 231 fields="[[getDeviceFields_(networkProperties)]]" | 167 <div class="layout vertical indented"> |
| 232 property-dict="[[networkProperties]]"> | 168 <!-- Advanced properties --> |
| 233 </network-property-list> | 169 <network-property-list |
| 234 </iron-collapse> | 170 hidden$="[[!hasAdvancedFields_(networkProperties)]]" |
| 235 </div> | 171 fields="[[getAdvancedFields_(networkProperties)]]" |
| 236 </iron-collapse> | 172 property-dict="[[networkProperties]]"> |
| 173 </network-property-list> | |
| 174 | |
| 175 <!-- Device properties --> | |
| 176 <network-property-list | |
| 177 hidden$="[[!hasDeviceFields_(networkProperties)]]" | |
| 178 fields="[[getDeviceFields_(networkProperties)]]" | |
| 179 property-dict="[[networkProperties]]"> | |
| 180 </network-property-list> | |
| 181 | |
| 182 <!-- network --> | |
| 183 <div class="layout vertical" | |
| 184 hidden$="[[!hasNetworkSection_(networkProperties)]]"> | |
| 185 <div class="subtitle indented">Network</div> | |
| 186 | |
| 187 <!-- APN --> | |
| 188 <network-apnlist editable on-apn-change="onNetworkPropertyChange_" | |
| 189 hidden$="[[!isType_(networkProperties, NetworkType.CELLULAR)]]" | |
| 190 network-properties="[[networkProperties]]"> | |
| 191 </network-apnlist> | |
| 192 <!-- IP Config --> | |
| 193 <network-ip-config editable on-ip-change="onIPConfigChange_" | |
| 194 network-properties="[[networkProperties]]"> | |
| 195 </network-ip-config> | |
| 196 <!-- Nameservers --> | |
| 197 <network-nameservers editable | |
| 198 on-nameservers-change="onIPConfigChange_" | |
| 199 network-properties="[[networkProperties]]"> | |
| 200 </network-nameservers> | |
| 201 </div> | |
| 202 | |
| 203 <!-- Proxy --> | |
| 204 <div class="subtitle">Proxy</div> | |
| 205 <div id="proxyDiv" class="layout vertical"> | |
| 206 <network-proxy editable on-proxy-change="onProxyChange_" | |
| 207 network-properties="[[networkProperties]]"> | |
| 208 </network-proxy> | |
| 237 </div> | 209 </div> |
| 238 </div> | 210 </div> |
| 239 </div> | 211 </iron-collapse> |
| 240 </template> | 212 </template> |
| 241 <script src="internet_detail_page.js"></script> | 213 <script src="internet_detail_page.js"></script> |
| 242 </dom-module> | 214 </dom-module> |
| OLD | NEW |