| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ONC Data support class. Wraps a dictionary object containing | 6 * @fileoverview ONC Data support class. Wraps a dictionary object containing |
| 7 * ONC managed or unmanaged dictionaries. Supports nested dictionaries, | 7 * ONC managed or unmanaged dictionaries. Supports nested dictionaries, |
| 8 * e.g. data.getManagedProperty('VPN.Type'). | 8 * e.g. data.getManagedProperty('VPN.Type'). |
| 9 */ | 9 */ |
| 10 cr.define('cr.onc', function() { | 10 cr.define('cr.onc', function() { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 * Returns the WiFi security type (defaults to 'None'). | 148 * Returns the WiFi security type (defaults to 'None'). |
| 149 * @return {string} The security type. | 149 * @return {string} The security type. |
| 150 */ | 150 */ |
| 151 getWiFiSecurity: function() { | 151 getWiFiSecurity: function() { |
| 152 var security = this.getActiveValue('WiFi.Security'); | 152 var security = this.getActiveValue('WiFi.Security'); |
| 153 if (security == undefined) | 153 if (security == undefined) |
| 154 return 'None'; | 154 return 'None'; |
| 155 return security; | 155 return security; |
| 156 }, | 156 }, |
| 157 | 157 |
| 158 /** | 158 /** |
| 159 * Updates the properties of |data_| from the properties in |update|. | 159 * Updates the properties of |data_| from the properties in |update|. |
| 160 * Note: this only looks at top level entries, so if a dictionary is | 160 * Note: this only looks at top level entries, so if a dictionary is |
| 161 * updated the entire dictionary is written over. TODO(stevenjb): | 161 * updated the entire dictionary is written over. TODO(stevenjb): |
| 162 * eliminate this function when |data_| contains only ONC entries and | 162 * eliminate this function when |data_| contains only ONC entries and |
| 163 * any updates consist of complete ONC dictionaries. | 163 * any updates consist of complete ONC dictionaries. |
| 164 * @param {Object} update Dictionary containing the updated properties. | 164 * @param {Object} update Dictionary containing the updated properties. |
| 165 */ | 165 */ |
| 166 updateData: function(update) { | 166 updateData: function(update) { |
| 167 for (var prop in update) { | 167 for (var prop in update) { |
| 168 if (prop in this.data_) | 168 if (prop in this.data_) |
| (...skipping 14 matching lines...) Expand all Loading... |
| 183 return property[effective]; | 183 return property[effective]; |
| 184 } | 184 } |
| 185 return undefined; | 185 return undefined; |
| 186 } | 186 } |
| 187 }; | 187 }; |
| 188 | 188 |
| 189 return { | 189 return { |
| 190 OncData: OncData | 190 OncData: OncData |
| 191 }; | 191 }; |
| 192 }); | 192 }); |
| OLD | NEW |