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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits/AuditLauncherView.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 years, 12 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 this._currentCategoriesCount += event.target.checked ? 1 : -1; 202 this._currentCategoriesCount += event.target.checked ? 1 : -1;
203 this._selectAllCheckboxElement.checked = this._currentCategoriesCount === th is._sortedCategories.length; 203 this._selectAllCheckboxElement.checked = this._currentCategoriesCount === th is._sortedCategories.length;
204 this._selectedCategoriesUpdated(true); 204 this._selectedCategoriesUpdated(true);
205 } 205 }
206 206
207 /** 207 /**
208 * @param {string} title 208 * @param {string} title
209 * @param {string=} id 209 * @param {string=} id
210 */ 210 */
211 _createCategoryElement(title, id) { 211 _createCategoryElement(title, id) {
212 var labelElement = createCheckboxLabel(title); 212 var labelElement = UI.createCheckboxLabel(title);
213 if (id) { 213 if (id) {
214 labelElement.id = this._categoryIdPrefix + id; 214 labelElement.id = this._categoryIdPrefix + id;
215 labelElement.checkboxElement.addEventListener('click', this._boundCategory ClickListener, false); 215 labelElement.checkboxElement.addEventListener('click', this._boundCategory ClickListener, false);
216 } 216 }
217 labelElement.__displayName = title; 217 labelElement.__displayName = title;
218 218
219 return labelElement; 219 return labelElement;
220 } 220 }
221 221
222 _createLauncherUI() { 222 _createLauncherUI() {
(...skipping 18 matching lines...) Expand all
241 this._selectAllCheckboxElement.addEventListener('click', handleSelectAllClic k.bind(this), false); 241 this._selectAllCheckboxElement.addEventListener('click', handleSelectAllClic k.bind(this), false);
242 this._contentElement.appendChild(categoryElement); 242 this._contentElement.appendChild(categoryElement);
243 243
244 this._categoriesElement = this._contentElement.createChild('fieldset', 'audi t-categories-container'); 244 this._categoriesElement = this._contentElement.createChild('fieldset', 'audi t-categories-container');
245 this._currentCategoriesCount = 0; 245 this._currentCategoriesCount = 0;
246 246
247 this._contentElement.createChild('div', 'flexible-space'); 247 this._contentElement.createChild('div', 'flexible-space');
248 248
249 this._buttonContainerElement = this._contentElement.createChild('div', 'butt on-container'); 249 this._buttonContainerElement = this._contentElement.createChild('div', 'butt on-container');
250 250
251 var radio = createRadioLabel('audit-mode', Common.UIString('Audit Present St ate'), true); 251 var radio = UI.createRadioLabel('audit-mode', Common.UIString('Audit Present State'), true);
252 this._buttonContainerElement.appendChild(radio); 252 this._buttonContainerElement.appendChild(radio);
253 this._auditPresentStateElement = radio.radioElement; 253 this._auditPresentStateElement = radio.radioElement;
254 254
255 radio = createRadioLabel('audit-mode', Common.UIString('Reload Page and Audi t on Load')); 255 radio = UI.createRadioLabel('audit-mode', Common.UIString('Reload Page and A udit on Load'));
256 this._buttonContainerElement.appendChild(radio); 256 this._buttonContainerElement.appendChild(radio);
257 this._auditReloadedStateElement = radio.radioElement; 257 this._auditReloadedStateElement = radio.radioElement;
258 258
259 this._launchButton = createTextButton(Common.UIString('Run'), this._launchBu ttonClicked.bind(this)); 259 this._launchButton = UI.createTextButton(Common.UIString('Run'), this._launc hButtonClicked.bind(this));
260 this._buttonContainerElement.appendChild(this._launchButton); 260 this._buttonContainerElement.appendChild(this._launchButton);
261 261
262 this._clearButton = createTextButton(Common.UIString('Clear'), this._clearBu ttonClicked.bind(this)); 262 this._clearButton = UI.createTextButton(Common.UIString('Clear'), this._clea rButtonClicked.bind(this));
263 this._buttonContainerElement.appendChild(this._clearButton); 263 this._buttonContainerElement.appendChild(this._clearButton);
264 264
265 this._selectAllClicked(this._selectAllCheckboxElement.checked); 265 this._selectAllClicked(this._selectAllCheckboxElement.checked);
266 } 266 }
267 267
268 _updateResourceProgress() { 268 _updateResourceProgress() {
269 if (this._displayResourceLoadingProgress) { 269 if (this._displayResourceLoadingProgress) {
270 this._progressIndicator.setTitle( 270 this._progressIndicator.setTitle(
271 Common.UIString('Loading (%d of %d)', this._loadedResources, this._tot alResources)); 271 Common.UIString('Loading (%d of %d)', this._loadedResources, this._tot alResources));
272 } 272 }
(...skipping 15 matching lines...) Expand all
288 this._updateButton(); 288 this._updateButton();
289 } 289 }
290 290
291 _updateButton() { 291 _updateButton() {
292 this._launchButton.textContent = this._auditRunning ? Common.UIString('Stop' ) : Common.UIString('Run'); 292 this._launchButton.textContent = this._auditRunning ? Common.UIString('Stop' ) : Common.UIString('Run');
293 this._launchButton.disabled = !this._currentCategoriesCount; 293 this._launchButton.disabled = !this._currentCategoriesCount;
294 } 294 }
295 }; 295 };
296 296
297 Audits.AuditLauncherView.AllCategoriesKey = '__AllCategories'; 297 Audits.AuditLauncherView.AllCategoriesKey = '__AllCategories';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698