OLD | NEW |
---|---|
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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 else | 608 else |
609 chrome.send('configureNetwork', [this.guid]); | 609 chrome.send('configureNetwork', [this.guid]); |
610 }, | 610 }, |
611 | 611 |
612 /** @private */ | 612 /** @private */ |
613 onViewAccountTap_: function() { | 613 onViewAccountTap_: function() { |
614 // startActivate() will show the account page for activated networks. | 614 // startActivate() will show the account page for activated networks. |
615 this.networkingPrivate.startActivate(this.guid); | 615 this.networkingPrivate.startActivate(this.guid); |
616 }, | 616 }, |
617 | 617 |
618 /** @private */ | |
619 onChooseMobileTap_: function() { | |
620 // TODO(stevenjb): Integrate ChooseMobileNetworkDialog with WebUI. | |
621 chrome.send('addNetwork', [this.networkProperties.Type]); | |
dpapad
2017/06/22 18:54:50
Drive by comment. Can you put chrome.send calls be
stevenjb
2017/06/22 19:51:37
No, it's not worth it, they will all be deprecated
| |
622 }, | |
623 | |
618 /** @const {string} */ | 624 /** @const {string} */ |
619 CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON', | 625 CR_EXPAND_BUTTON_TAG: 'CR-EXPAND-BUTTON', |
620 | 626 |
621 /** @private */ | 627 /** @private */ |
622 showTetherDialog_: function() { | 628 showTetherDialog_: function() { |
623 this.getTetherDialog_().open(); | 629 this.getTetherDialog_().open(); |
624 }, | 630 }, |
625 | 631 |
626 /** | 632 /** |
627 * @param {Event} event | 633 * @param {Event} event |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
967 if (networkProperties.Type == CrOnc.Type.CELLULAR) | 973 if (networkProperties.Type == CrOnc.Type.CELLULAR) |
968 return true; | 974 return true; |
969 return this.isRememberedOrConnected_(networkProperties); | 975 return this.isRememberedOrConnected_(networkProperties); |
970 }, | 976 }, |
971 | 977 |
972 /** | 978 /** |
973 * @param {!CrOnc.NetworkProperties} networkProperties | 979 * @param {!CrOnc.NetworkProperties} networkProperties |
974 * @return {boolean} | 980 * @return {boolean} |
975 * @private | 981 * @private |
976 */ | 982 */ |
977 showCellularSim_: function(networkProperties) { | 983 showCellularChooseNetwork_: function(networkProperties) { |
978 if (networkProperties.Type != 'Cellular' || !networkProperties.Cellular) { | 984 return networkProperties.Type == CrOnc.Type.CELLULAR && |
979 return false; | 985 !!this.get('Cellular.SupportNetworkScan', this.networkProperties); |
980 } | |
981 return networkProperties.Cellular.Family == 'GSM'; | |
982 }, | 986 }, |
983 | 987 |
984 /** | 988 /** |
989 * @param {!CrOnc.NetworkProperties} networkProperties | |
990 * @return {boolean} | |
991 * @private | |
992 */ | |
993 showCellularSim_: function(networkProperties) { | |
994 return networkProperties.Type == CrOnc.Type.CELLULAR && | |
995 this.get('Cellular.Family', this.networkProperties) == | |
996 CrOnc.NetworkTechnology.GSM; | |
997 }, | |
998 | |
999 /** | |
985 * @param {!Object} curValue | 1000 * @param {!Object} curValue |
986 * @param {!Object} newValue | 1001 * @param {!Object} newValue |
987 * @return {boolean} True if all properties set in |newValue| are equal to | 1002 * @return {boolean} True if all properties set in |newValue| are equal to |
988 * the corresponding properties in |curValue|. Note: Not all properties | 1003 * the corresponding properties in |curValue|. Note: Not all properties |
989 * of |curValue| need to be specified in |newValue| for this to return | 1004 * of |curValue| need to be specified in |newValue| for this to return |
990 * true. | 1005 * true. |
991 * @private | 1006 * @private |
992 */ | 1007 */ |
993 allPropertiesMatch_: function(curValue, newValue) { | 1008 allPropertiesMatch_: function(curValue, newValue) { |
994 for (var key in newValue) { | 1009 for (var key in newValue) { |
995 if (newValue[key] != curValue[key]) | 1010 if (newValue[key] != curValue[key]) |
996 return false; | 1011 return false; |
997 } | 1012 } |
998 return true; | 1013 return true; |
999 } | 1014 } |
1000 }); | 1015 }); |
1001 })(); | 1016 })(); |
OLD | NEW |