Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(870)

Side by Side Diff: chrome/browser/resources/settings/internet_page/internet_detail_page.js

Issue 2856023002: MD Settings: Internet: Fix IP config visibility (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * 'settings-internet-detail' is the settings subpage containing details 7 * 'settings-internet-detail' is the settings subpage containing details
8 * for a network. 8 * for a network.
9 */ 9 */
10 (function() { 10 (function() {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 this.preferNetwork_ = preferNetwork; 237 this.preferNetwork_ = preferNetwork;
238 238
239 // Set the IPAddress property to the IPV4 Address. 239 // Set the IPAddress property to the IPV4 Address.
240 var ipv4 = 240 var ipv4 =
241 CrOnc.getIPConfigForType(this.networkProperties, CrOnc.IPType.IPV4); 241 CrOnc.getIPConfigForType(this.networkProperties, CrOnc.IPType.IPV4);
242 this.IPAddress_ = (ipv4 && ipv4.IPAddress) || ''; 242 this.IPAddress_ = (ipv4 && ipv4.IPAddress) || '';
243 243
244 // Update the detail page title. 244 // Update the detail page title.
245 this.parentNode.pageTitle = CrOnc.getNetworkName(this.networkProperties); 245 this.parentNode.pageTitle = CrOnc.getNetworkName(this.networkProperties);
246 246
247 // Focus a button once the initial state is set. 247 Polymer.dom.flush();
248 if (!this.didSetFocus_) { 248
249 if (this.didSetFocus_) {
250 // Focus a button once the initial state is set.
249 this.didSetFocus_ = true; 251 this.didSetFocus_ = true;
250 var button = this.$$('#buttonDiv .primary-button:not([hidden])'); 252 var button = this.$$('#buttonDiv .primary-button:not([hidden])');
251 if (!button) 253 if (!button)
252 button = this.$$('#buttonDiv .secondary-button:not([hidden])'); 254 button = this.$$('#buttonDiv .secondary-button:not([hidden])');
253 assert(button); // At least one button will always be visible. 255 assert(button); // At least one button will always be visible.
254 button.focus(); 256 button.focus();
255 } 257 }
256 258
257 if (this.shoudlShowConfigureWhenNetworkLoaded_ 259 if (this.shoudlShowConfigureWhenNetworkLoaded_
258 && this.networkProperties.Tether) { 260 && this.networkProperties.Tether) {
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 */ 991 */
990 showCellularSim_: function(networkProperties) { 992 showCellularSim_: function(networkProperties) {
991 if (networkProperties.Type != 'Cellular' || 993 if (networkProperties.Type != 'Cellular' ||
992 !networkProperties.Cellular) { 994 !networkProperties.Cellular) {
993 return false; 995 return false;
994 } 996 }
995 return networkProperties.Cellular.Family == 'GSM'; 997 return networkProperties.Cellular.Family == 'GSM';
996 }, 998 },
997 999
998 /** 1000 /**
999 * @param {!CrOnc.NetworkProperties} networkProperties
1000 * @return {boolean}
1001 * @private
1002 */
1003 showIpConfig_: function(networkProperties) {
1004 if (!this.isRememberedOrConnected_(networkProperties))
1005 return false;
1006 return !!networkProperties.IPAddressConfigType;
1007 },
1008
1009 /**
1010 * @param {!Object} curValue 1001 * @param {!Object} curValue
1011 * @param {!Object} newValue 1002 * @param {!Object} newValue
1012 * @return {boolean} True if all properties set in |newValue| are equal to 1003 * @return {boolean} True if all properties set in |newValue| are equal to
1013 * the corresponding properties in |curValue|. Note: Not all properties 1004 * the corresponding properties in |curValue|. Note: Not all properties
1014 * of |curValue| need to be specified in |newValue| for this to return 1005 * of |curValue| need to be specified in |newValue| for this to return
1015 * true. 1006 * true.
1016 * @private 1007 * @private
1017 */ 1008 */
1018 allPropertiesMatch_: function(curValue, newValue) { 1009 allPropertiesMatch_: function(curValue, newValue) {
1019 for (var key in newValue) { 1010 for (var key in newValue) {
1020 if (newValue[key] != curValue[key]) 1011 if (newValue[key] != curValue[key])
1021 return false; 1012 return false;
1022 } 1013 }
1023 return true; 1014 return true;
1024 } 1015 }
1025 }); 1016 });
1026 })(); 1017 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698