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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/settings/SettingsScreen.js

Issue 2604883002: DevTools: namespace globals (Closed)
Patch Set: address CL feedback Created 3 years, 11 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 /** @type {!Map<string, !Element>} */ 170 /** @type {!Map<string, !Element>} */
171 this._nameToSection = new Map(); 171 this._nameToSection = new Map();
172 /** @type {!Map<string, !Element>} */ 172 /** @type {!Map<string, !Element>} */
173 this._nameToSettingElement = new Map(); 173 this._nameToSettingElement = new Map();
174 for (var sectionName of explicitSectionOrder) 174 for (var sectionName of explicitSectionOrder)
175 this._sectionElement(sectionName); 175 this._sectionElement(sectionName);
176 self.runtime.extensions('setting').forEach(this._addSetting.bind(this)); 176 self.runtime.extensions('setting').forEach(this._addSetting.bind(this));
177 self.runtime.extensions(UI.SettingUI).forEach(this._addSettingUI.bind(this)) ; 177 self.runtime.extensions(UI.SettingUI).forEach(this._addSettingUI.bind(this)) ;
178 178
179 this._appendSection().appendChild( 179 this._appendSection().appendChild(
180 createTextButton(Common.UIString('Restore defaults and reload'), restore AndReload)); 180 UI.createTextButton(Common.UIString('Restore defaults and reload'), rest oreAndReload));
181 181
182 function restoreAndReload() { 182 function restoreAndReload() {
183 Common.settings.clearAll(); 183 Common.settings.clearAll();
184 Components.reload(); 184 Components.reload();
185 } 185 }
186 } 186 }
187 187
188 /** 188 /**
189 * @param {!Runtime.Extension} extension 189 * @param {!Runtime.Extension} extension
190 * @return {boolean} 190 * @return {boolean}
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 Workspace.isolatedFileSystemManager.addEventListener( 283 Workspace.isolatedFileSystemManager.addEventListener(
284 Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, this._file SystemRemoved, this); 284 Workspace.IsolatedFileSystemManager.Events.FileSystemRemoved, this._file SystemRemoved, this);
285 285
286 var folderExcludePatternInput = this._createFolderExcludePatternInput(); 286 var folderExcludePatternInput = this._createFolderExcludePatternInput();
287 folderExcludePatternInput.classList.add('folder-exclude-pattern'); 287 folderExcludePatternInput.classList.add('folder-exclude-pattern');
288 this.containerElement.appendChild(folderExcludePatternInput); 288 this.containerElement.appendChild(folderExcludePatternInput);
289 289
290 this._fileSystemsListContainer = this.containerElement.createChild('div', '' ); 290 this._fileSystemsListContainer = this.containerElement.createChild('div', '' );
291 291
292 this.containerElement.appendChild( 292 this.containerElement.appendChild(
293 createTextButton(Common.UIString('Add folder\u2026'), this._addFileSyste mClicked.bind(this))); 293 UI.createTextButton(Common.UIString('Add folder\u2026'), this._addFileSy stemClicked.bind(this)));
294 294
295 /** @type {!Map<string, !Element>} */ 295 /** @type {!Map<string, !Element>} */
296 this._elementByPath = new Map(); 296 this._elementByPath = new Map();
297 297
298 /** @type {!Map<string, !Settings.EditFileSystemView>} */ 298 /** @type {!Map<string, !Settings.EditFileSystemView>} */
299 this._mappingViewByPath = new Map(); 299 this._mappingViewByPath = new Map();
300 300
301 var fileSystems = Workspace.isolatedFileSystemManager.fileSystems(); 301 var fileSystems = Workspace.isolatedFileSystemManager.fileSystems();
302 for (var i = 0; i < fileSystems.length; ++i) 302 for (var i = 0; i < fileSystems.length; ++i)
303 this._addItem(fileSystems[i]); 303 this._addItem(fileSystems[i]);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 var subsection = createElement('div'); 431 var subsection = createElement('div');
432 var warning = subsection.createChild('span', 'settings-experiments-warning-s ubsection-warning'); 432 var warning = subsection.createChild('span', 'settings-experiments-warning-s ubsection-warning');
433 warning.textContent = Common.UIString('WARNING:'); 433 warning.textContent = Common.UIString('WARNING:');
434 subsection.createTextChild(' '); 434 subsection.createTextChild(' ');
435 var message = subsection.createChild('span', 'settings-experiments-warning-s ubsection-message'); 435 var message = subsection.createChild('span', 'settings-experiments-warning-s ubsection-message');
436 message.textContent = Common.UIString('These experiments could be dangerous and may require restart.'); 436 message.textContent = Common.UIString('These experiments could be dangerous and may require restart.');
437 return subsection; 437 return subsection;
438 } 438 }
439 439
440 _createExperimentCheckbox(experiment) { 440 _createExperimentCheckbox(experiment) {
441 var label = createCheckboxLabel(Common.UIString(experiment.title), experimen t.isEnabled()); 441 var label = UI.createCheckboxLabel(Common.UIString(experiment.title), experi ment.isEnabled());
442 var input = label.checkboxElement; 442 var input = label.checkboxElement;
443 input.name = experiment.name; 443 input.name = experiment.name;
444 function listener() { 444 function listener() {
445 experiment.setEnabled(input.checked); 445 experiment.setEnabled(input.checked);
446 } 446 }
447 input.addEventListener('click', listener, false); 447 input.addEventListener('click', listener, false);
448 448
449 var p = createElement('p'); 449 var p = createElement('p');
450 p.className = experiment.hidden && !experiment.isEnabled() ? 'settings-exper iment-hidden' : ''; 450 p.className = experiment.hidden && !experiment.isEnabled() ? 'settings-exper iment-hidden' : '';
451 p.appendChild(label); 451 p.appendChild(label);
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return; 535 return;
536 var settings = extension.descriptor()['settings']; 536 var settings = extension.descriptor()['settings'];
537 if (settings && settings.indexOf(setting.name) !== -1) { 537 if (settings && settings.indexOf(setting.name) !== -1) {
538 InspectorFrontendHost.bringToFront(); 538 InspectorFrontendHost.bringToFront();
539 Settings.SettingsScreen._showSettingsScreen(extension.descriptor()['id'] ); 539 Settings.SettingsScreen._showSettingsScreen(extension.descriptor()['id'] );
540 success = true; 540 success = true;
541 } 541 }
542 } 542 }
543 } 543 }
544 }; 544 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698