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

Side by Side Diff: chrome/browser/resources/options/chromeos/onc_data.js

Issue 983823002: Use GUID instead of servicePath in network settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_enable_extension_apis
Patch Set: . 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 unified diff | Download patch
OLDNEW
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 10
11 cr.exportPath('cr.onc'); 11 cr.exportPath('cr.onc');
12 12
13 cr.define('cr.onc', function() { 13 cr.define('cr.onc', function() {
14 'use strict'; 14 'use strict';
15 15
16 /** 16 /**
17 * @constructor 17 * @constructor
18 */ 18 */
19 function OncData(data) { 19 function OncData(data) {
20 this.data_ = data; 20 this.data_ = data;
21 } 21 }
22 22
23 OncData.prototype = { 23 OncData.prototype = {
24 /** @return {string} The GUID of the network. */
25 guid: function() { return this.data_['GUID']; },
24 26
25 /** 27 /**
26 * Returns either a managed property dictionary or an unmanaged value. 28 * Returns either a managed property dictionary or an unmanaged value.
27 * @param {string} key The property key. 29 * @param {string} key The property key.
28 * @return {?} The property value or dictionary if it exists, otherwise 30 * @return {?} The property value or dictionary if it exists, otherwise
29 * undefined. 31 * undefined.
30 */ 32 */
31 getManagedProperty: function(key) { 33 getManagedProperty: function(key) {
32 var data = this.data_; 34 var data = this.data_;
33 while (true) { 35 while (true) {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 */ 186 */
185 getData: function() { 187 getData: function() {
186 return this.data_; 188 return this.data_;
187 } 189 }
188 }; 190 };
189 191
190 return { 192 return {
191 OncData: OncData 193 OncData: OncData
192 }; 194 };
193 }); 195 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698