OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NOTE(stevenjb): This code is in the process of being converted to be | 5 // NOTE(stevenjb): This code is in the process of being converted to be |
6 // compatible with the networkingPrivate extension API: | 6 // compatible with the networkingPrivate extension API: |
7 // * The network property dictionaries are being converted to use ONC values. | 7 // * The network property dictionaries are being converted to use ONC values. |
8 // * chrome.send calls will be replaced with an API object that simulates the | 8 // * chrome.send calls will be replaced with an API object that simulates the |
9 // networkingPrivate API. See network_config.js. | 9 // networkingPrivate API. See network_config.js. |
10 // See crbug.com/279351 for more info. | 10 // See crbug.com/279351 for more info. |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 * @param {string} selector CSS selector for extracting a list of elements. | 143 * @param {string} selector CSS selector for extracting a list of elements. |
144 * @param {bool} hidden New hidden value. | 144 * @param {bool} hidden New hidden value. |
145 */ | 145 */ |
146 function updateHidden(selector, hidden) { | 146 function updateHidden(selector, hidden) { |
147 var elements = cr.doc.querySelectorAll(selector); | 147 var elements = cr.doc.querySelectorAll(selector); |
148 for (var i = 0, el; el = elements[i]; i++) { | 148 for (var i = 0, el; el = elements[i]; i++) { |
149 el.hidden = hidden; | 149 el.hidden = hidden; |
150 } | 150 } |
151 } | 151 } |
152 | 152 |
153 /* | 153 /** |
154 * Helper function to update the properties of the data object from the | 154 * Helper function to update the properties of the data object from the |
155 * properties in the update object. | 155 * properties in the update object. |
156 * @param {object} data object to update. | 156 * @param {Object} data Object to update. |
157 * @param {object} object containing the updated properties. | 157 * @param {Object} update Object containing the updated properties. |
158 */ | 158 */ |
159 function updateDataObject(data, update) { | 159 function updateDataObject(data, update) { |
160 for (var prop in update) { | 160 for (var prop in update) { |
161 if (prop in data) | 161 if (prop in data) |
162 data[prop] = update[prop]; | 162 data[prop] = update[prop]; |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 /** | 166 /** |
167 * Monitor pref change of given element. | 167 * Monitor pref change of given element. |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 model.value = model.automatic; | 516 model.value = model.automatic; |
517 fields[i].model = model; | 517 fields[i].model = model; |
518 } | 518 } |
519 } | 519 } |
520 if (!checked) | 520 if (!checked) |
521 $('ip-address').focus(); | 521 $('ip-address').focus(); |
522 }, | 522 }, |
523 | 523 |
524 /** | 524 /** |
525 * Handler for when the name server selection changes. | 525 * Handler for when the name server selection changes. |
526 * @param {Event} e The click event. | 526 * @param {Event} event The click event. |
527 * @private | 527 * @private |
528 */ | 528 */ |
529 handleNameServerTypeChange_: function(event) { | 529 handleNameServerTypeChange_: function(event) { |
530 var type = event.target.value; | 530 var type = event.target.value; |
531 DetailsInternetPage.updateNameServerDisplay(type); | 531 DetailsInternetPage.updateNameServerDisplay(type); |
532 }, | 532 }, |
533 | 533 |
534 /** | 534 /** |
535 * Creates an indicator event for controlled properties using | 535 * Creates an indicator event for controlled properties using |
536 * the same dictionary format as CoreOptionsHandler::CreateValueForPref. | 536 * the same dictionary format as CoreOptionsHandler::CreateValueForPref. |
537 * @param {string} name The name for the Event. | 537 * @param {string} name The name for the Event. |
538 * @param {Object} data Property dictionary with |value|, |controlledBy|, | 538 * @param {Object} propData Property dictionary with |value|, |
539 * and |recommendedValue| properties set. | 539 * |controlledBy|, and |recommendedValue| properties set. |
540 * @private | 540 * @private |
541 */ | 541 */ |
542 createControlledEvent_: function(name, propData) { | 542 createControlledEvent_: function(name, propData) { |
543 var event = new Event(name); | 543 var event = new Event(name); |
544 event.value = { | 544 event.value = { |
545 value: propData.value, | 545 value: propData.value, |
546 controlledBy: propData.controlledBy, | 546 controlledBy: propData.controlledBy, |
547 recommendedValue: propData.recommendedValue | 547 recommendedValue: propData.recommendedValue |
548 }; | 548 }; |
549 return event; | 549 return event; |
550 }, | 550 }, |
551 | 551 |
552 /** | 552 /** |
553 * Creates an indicator event for controlled properties using | 553 * Creates an indicator event for controlled properties using |
554 * the ONC getManagedProperties dictionary format. | 554 * the ONC getManagedProperties dictionary format. |
555 * @param {string} name The name for the Event. | 555 * @param {string} name The name for the Event. |
556 * @param {Object} data ONC managed network property dictionary. | 556 * @param {Object} propData ONC managed network property dictionary. |
557 * @private | 557 * @private |
558 */ | 558 */ |
559 createManagedEvent_: function(name, propData) { | 559 createManagedEvent_: function(name, propData) { |
560 var event = new Event(name); | 560 var event = new Event(name); |
561 event.value = {}; | 561 event.value = {}; |
562 | 562 |
563 // Set the current value and recommended value. | 563 // Set the current value and recommended value. |
564 var activeValue = propData['Active']; | 564 var activeValue = propData['Active']; |
565 var effective = propData['Effective']; | 565 var effective = propData['Effective']; |
566 if (activeValue == undefined) | 566 if (activeValue == undefined) |
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1488 | 1488 |
1489 // Don't show page name in address bar and in history to prevent people | 1489 // Don't show page name in address bar and in history to prevent people |
1490 // navigate here by hand and solve issue with page session restore. | 1490 // navigate here by hand and solve issue with page session restore. |
1491 PageManager.showPageByName('detailsInternetPage', false); | 1491 PageManager.showPageByName('detailsInternetPage', false); |
1492 }; | 1492 }; |
1493 | 1493 |
1494 return { | 1494 return { |
1495 DetailsInternetPage: DetailsInternetPage | 1495 DetailsInternetPage: DetailsInternetPage |
1496 }; | 1496 }; |
1497 }); | 1497 }); |
OLD | NEW |