| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * This variable structure is here to document the structure that the template | 6 * This variable structure is here to document the structure that the template |
| 7 * expects to correctly populate the page. | 7 * expects to correctly populate the page. |
| 8 */ | 8 */ |
| 9 var flagsExperimentsDataFormat = { | 9 var flagsExperimentsDataFormat = { |
| 10 'flagsExperiments': [ | 10 'flagsExperiments': [ |
| 11 { | 11 { |
| 12 'internal_name': 'Experiment ID string', | 12 'internal_name': 'Experiment ID string', |
| 13 'name': 'Experiment Name', | 13 'name': 'Experiment Name', |
| 14 'description': 'description', | 14 'description': 'description', |
| 15 // enabled is only set if the experiment is single valued. | 15 // enabled is only set if the experiment is single valued. |
| 16 'enabled': true, | 16 'enabled': true, |
| 17 // choices is only set if the experiment has multiple values. | 17 // choices is only set if the experiment has multiple values. |
| 18 'choices': [ | 18 'choices': [ |
| 19 { | 19 { |
| 20 'internal_name': 'Experiment ID string', | 20 'internal_name': 'Experiment ID string', |
| 21 'description': 'description', | 21 'description': 'description', |
| 22 'selected': true | 22 'selected': true |
| 23 } | 23 } |
| 24 ] | 24 ], |
| 25 'supported': true, |
| 26 'supported_platforms' : [ |
| 27 'Mac', |
| 28 'Linux' |
| 29 ], |
| 25 } | 30 } |
| 26 ], | 31 ], |
| 27 'needsRestart': false | 32 'needsRestart': false |
| 28 }; | 33 }; |
| 29 | 34 |
| 30 /** | 35 /** |
| 31 * Takes the |flagsExperimentsData| input argument which represents data about | 36 * Takes the |flagsExperimentsData| input argument which represents data about |
| 32 * the currently available experiments and populates the html jstemplate | 37 * the currently available experiments and populates the html jstemplate |
| 33 * with that data. It expects an object structure like the above. | 38 * with that data. It expects an object structure like the above. |
| 34 * @param {Object} flagsExperimentsData Information about available experiments | 39 * @param {Object} flagsExperimentsData Information about available experiments |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 function handleSelectChoiceExperiment(node, index) { | 118 function handleSelectChoiceExperiment(node, index) { |
| 114 // Tell the C++ FlagsDOMHandler to enable the selected choice. | 119 // Tell the C++ FlagsDOMHandler to enable the selected choice. |
| 115 chrome.send('enableFlagsExperiment', | 120 chrome.send('enableFlagsExperiment', |
| 116 [String(node.internal_name) + "@" + index, "true"]); | 121 [String(node.internal_name) + "@" + index, "true"]); |
| 117 requestFlagsExperimentsData(); | 122 requestFlagsExperimentsData(); |
| 118 } | 123 } |
| 119 | 124 |
| 120 // Get data and have it displayed upon loading. | 125 // Get data and have it displayed upon loading. |
| 121 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); | 126 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); |
| 122 | 127 |
| OLD | NEW |