OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <style> | 5 <style> |
6 body { | 6 body { |
7 margin: 10px; | 7 margin: 10px; |
8 min-width: 47em; | 8 min-width: 47em; |
9 } | 9 } |
10 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 * @param {Object} flagsExperimentsData Information about available experiments | 189 * @param {Object} flagsExperimentsData Information about available experiments |
190 */ | 190 */ |
191 function renderTemplate(flagsExperimentsData) { | 191 function renderTemplate(flagsExperimentsData) { |
192 // This is the javascript code that processes the template: | 192 // This is the javascript code that processes the template: |
193 var input = new JsEvalContext(flagsExperimentsData); | 193 var input = new JsEvalContext(flagsExperimentsData); |
194 var output = document.getElementById('flagsExperimentTemplate'); | 194 var output = document.getElementById('flagsExperimentTemplate'); |
195 jstProcess(input, output); | 195 jstProcess(input, output); |
196 } | 196 } |
197 | 197 |
198 /** | 198 /** |
199 * Asks the C++ LabsDOMHandler to get details about the available experiments | 199 * Asks the C++ FlagsDOMHandler to get details about the available experiments |
200 * and return detailed data about the configuration. The LabsDOMHandler | 200 * and return detailed data about the configuration. The FlagsDOMHandler |
201 * should reply to returnFlagsExperiments() (below). | 201 * should reply to returnFlagsExperiments() (below). |
202 */ | 202 */ |
203 function requestFlagsExperimentsData() { | 203 function requestFlagsExperimentsData() { |
204 chrome.send('requestFlagsExperiments', []); | 204 chrome.send('requestFlagsExperiments', []); |
205 } | 205 } |
206 | 206 |
207 /** | 207 /** |
208 * Asks the C++ LabsDOMHandler to restart the browser (restoring tabs). | 208 * Asks the C++ FlagsDOMHandler to restart the browser (restoring tabs). |
209 */ | 209 */ |
210 function restartBrowser() { | 210 function restartBrowser() { |
211 chrome.send('restartBrowser', []); | 211 chrome.send('restartBrowser', []); |
212 } | 212 } |
213 | 213 |
214 /** | 214 /** |
215 * Called by the dom_ui to re-populate the page with data representing the | 215 * Called by the dom_ui to re-populate the page with data representing the |
216 * current state of installed experiments. | 216 * current state of installed experiments. |
217 */ | 217 */ |
218 function returnFlagsExperiments(flagsExperimentsData){ | 218 function returnFlagsExperiments(flagsExperimentsData){ |
219 var bodyContainer = document.getElementById('body-container'); | 219 var bodyContainer = document.getElementById('body-container'); |
220 renderTemplate(flagsExperimentsData); | 220 renderTemplate(flagsExperimentsData); |
221 bodyContainer.style.visibility = 'visible'; | 221 bodyContainer.style.visibility = 'visible'; |
222 } | 222 } |
223 | 223 |
224 /** | 224 /** |
225 * Handles a 'enable' or 'disable' button getting clicked. | 225 * Handles a 'enable' or 'disable' button getting clicked. |
226 */ | 226 */ |
227 function handleEnableExperiment(node, enable) { | 227 function handleEnableExperiment(node, enable) { |
228 // Tell the C++ LabsDOMHandler to enable/disable the experiment. | 228 // Tell the C++ FlagsDOMHandler to enable/disable the experiment. |
229 chrome.send('enableFlagsExperiment', [String(node.internal_name), | 229 chrome.send('enableFlagsExperiment', [String(node.internal_name), |
230 String(enable)]); | 230 String(enable)]); |
231 requestFlagsExperimentsData(); | 231 requestFlagsExperimentsData(); |
232 } | 232 } |
233 | 233 |
234 // Get data and have it displayed upon loading. | 234 // Get data and have it displayed upon loading. |
235 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); | 235 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); |
236 | 236 |
237 </script> | 237 </script> |
238 </head> | 238 </head> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 <div i18n-content="flagsRestartNotice">NEEDS_RESTART</div> | 312 <div i18n-content="flagsRestartNotice">NEEDS_RESTART</div> |
313 <button type="button" | 313 <button type="button" |
314 onclick="restartBrowser();" | 314 onclick="restartBrowser();" |
315 i18n-content="flagsRestartButton">RESTART</button> | 315 i18n-content="flagsRestartButton">RESTART</button> |
316 </div> | 316 </div> |
317 </div> | 317 </div> |
318 </div> | 318 </div> |
319 </div> | 319 </div> |
320 </body> | 320 </body> |
321 </html> | 321 </html> |
OLD | NEW |