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

Side by Side Diff: chrome/browser/resources/flags.js

Issue 23532034: Postpone loading about:flags ui until the certificates have been loaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/flags.html ('k') | chrome/browser/ui/webui/flags_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 /** 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 9
10 /** 10 /**
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 * 'Mac', 124 * 'Mac',
125 * 'Linux' 125 * 'Linux'
126 * ], 126 * ],
127 * } 127 * }
128 * ], 128 * ],
129 * unsupportedExperiments: [ 129 * unsupportedExperiments: [
130 * // Mirrors the format of |supportedExperiments| above. 130 * // Mirrors the format of |supportedExperiments| above.
131 * ], 131 * ],
132 * needsRestart: false, 132 * needsRestart: false,
133 * showBetaChannelPromotion: false, 133 * showBetaChannelPromotion: false,
134 * showDevChannelPromotion: false 134 * showDevChannelPromotion: false,
135 * showOwnerWarning: false
135 * } 136 * }
136 */ 137 */
137 function returnFlagsExperiments(experimentsData) { 138 function returnFlagsExperiments(experimentsData) {
138 var bodyContainer = $('body-container'); 139 var bodyContainer = $('body-container');
139 renderTemplate(experimentsData); 140 renderTemplate(experimentsData);
140 141
141 if (experimentsData.showBetaChannelPromotion) 142 if (experimentsData.showBetaChannelPromotion)
142 $('channel-promo-beta').hidden = false; 143 $('channel-promo-beta').hidden = false;
143 else if (experimentsData.showDevChannelPromotion) 144 else if (experimentsData.showDevChannelPromotion)
144 $('channel-promo-dev').hidden = false; 145 $('channel-promo-dev').hidden = false;
145 146
146 bodyContainer.style.visibility = 'visible'; 147 bodyContainer.style.visibility = 'visible';
148 var ownerWarningDiv = $('owner-warning');
149 if (ownerWarningDiv)
150 ownerWarningDiv.hidden = !experimentsData.showOwnerWarning;
147 } 151 }
148 152
149 /** 153 /**
150 * Handles a 'enable' or 'disable' button getting clicked. 154 * Handles a 'enable' or 'disable' button getting clicked.
151 * @param {HTMLElement} node The node for the experiment being changed. 155 * @param {HTMLElement} node The node for the experiment being changed.
152 * @param {boolean} enable Whether to enable or disable the experiment. 156 * @param {boolean} enable Whether to enable or disable the experiment.
153 */ 157 */
154 function handleEnableExperiment(node, enable) { 158 function handleEnableExperiment(node, enable) {
155 // Tell the C++ FlagsDOMHandler to enable/disable the experiment. 159 // Tell the C++ FlagsDOMHandler to enable/disable the experiment.
156 chrome.send('enableFlagsExperiment', [String(node.internal_name), 160 chrome.send('enableFlagsExperiment', [String(node.internal_name),
(...skipping 12 matching lines...) Expand all
169 chrome.send('enableFlagsExperiment', 173 chrome.send('enableFlagsExperiment',
170 [String(node.internal_name) + '@' + index, 'true']); 174 [String(node.internal_name) + '@' + index, 'true']);
171 requestFlagsExperimentsData(); 175 requestFlagsExperimentsData();
172 } 176 }
173 177
174 // Get data and have it displayed upon loading. 178 // Get data and have it displayed upon loading.
175 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData); 179 document.addEventListener('DOMContentLoaded', requestFlagsExperimentsData);
176 180
177 // Update the highlighted flag when the hash changes. 181 // Update the highlighted flag when the hash changes.
178 window.addEventListener('hashchange', highlightReferencedFlag); 182 window.addEventListener('hashchange', highlightReferencedFlag);
OLDNEW
« no previous file with comments | « chrome/browser/resources/flags.html ('k') | chrome/browser/ui/webui/flags_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698