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

Unified Diff: ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js

Issue 1030963003: Use networkingPrivate types in JS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js
diff --git a/ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js b/ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js
index 1d87b7494756b778fe9a9b03f6a76182aab79bde..c1a484afd0a513669f1412eb9e88b34d9c487f59 100644
--- a/ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js
+++ b/ui/webui/resources/cr_elements/cr_onc/cr_onc_data.js
@@ -5,8 +5,7 @@
/**
* @fileoverview ONC network configuration support class. Wraps a dictionary
* object containing ONC managed or unmanaged dictionaries. Also provides
- * special accessors for ONC properties. See cr-onc-types for ONC types,
- * e.g. CrOnc.NetworkConfigType. Used by consumers of the
+ * special accessors for ONC properties. Used by consumers of the
* chrome.networkingPrivate API. See components/onc/docs/onc_spec.html.
*/
Polymer('cr-onc-data', {
@@ -16,7 +15,7 @@ Polymer('cr-onc-data', {
* chrome.networkingPrivate.getProperties() call.
*
* @attribute data
- * @type CrOnc.NetworkConfigType
+ * @type chrome.networkingPrivate.NetworkStateProperties
* @default null
*/
data: null,
@@ -24,17 +23,20 @@ Polymer('cr-onc-data', {
/** @override */
created: function() {
- this.data = /** @type {CrOnc.NetworkConfigType} */({});
+ this.data =
+ /** @type {chrome.networkingPrivate.NetworkStateProperties} */({});
},
/** @return {boolean} True if the network is connected. */
connected: function() {
- return this.data.ConnectionState == CrOnc.ConnectionState.CONNECTED;
+ return this.data.ConnectionState ==
+ chrome.networkingPrivate.ConnectionStateType.Connected;
michaelpg 2015/03/31 19:18:46 4 spaces 33, 39
},
/** @return {boolean} True if the network is connecting. */
connecting: function() {
- return this.data.ConnectionState == CrOnc.ConnectionState.CONNECTING;
+ return this.data.ConnectionState ==
+ chrome.networkingPrivate.ConnectionStateType.Connecting;
},
/** @return {number} The signal strength of the network. */
@@ -50,22 +52,22 @@ Polymer('cr-onc-data', {
return strength;
},
- /** @return {CrOnc.Security} The ONC security type. */
+ /** @return {DOMString} The ONC security type. */
getWiFiSecurity: function() {
return (this.data.WiFi && this.data.WiFi.Security) ?
- this.data.WiFi.Security : CrOnc.Security.NONE;
+ this.data.WiFi.Security : 'None';
},
- /** @return {CrOnc.RoamingState} The ONC roaming state. */
+ /** @return {DOMString} The ONC roaming state. */
getCellularRoamingState: function() {
return (this.data.Cellular && this.data.Cellular.RoamingState) ?
- this.data.Cellular.RoamingState : CrOnc.RoamingState.UNKNOWN;
+ this.data.Cellular.RoamingState : 'Unknown';
},
- /** @return {CrOnc.NetworkTechnology} The ONC network technology. */
+ /** @return {DOMString} The ONC network technology. */
getCellularTechnology: function() {
return (this.data.Cellular && this.data.Cellular.NetworkTechnology) ?
- this.data.Cellular.NetworkTechnology : CrOnc.NetworkTechnology.UNKNOWN;
+ this.data.Cellular.NetworkTechnology : 'Unknown';
}
});
@@ -78,7 +80,8 @@ var CrOncDataElement = {};
* Helper method to create and return a typed cr-onc-data Polymer element.
* Sets the data property of the element to |state|.
*
- * @param {!CrOnc.NetworkConfigType} state The network state properties.
+ * @param {!chrome.networkingPrivate.NetworkStateProperties} state The network
+ * state properties.
* @return {!CrOncDataElement} A cr-onc-data element.
*/
CrOncDataElement.create = function(state) {

Powered by Google App Engine
This is Rietveld 408576698