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

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

Issue 1049483003: [Extensions] Update extensions UI to observe events and add test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 // 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 <include src="../../../../ui/webui/resources/js/cr/ui/focus_row.js"> 5 <include src="../../../../ui/webui/resources/js/cr/ui/focus_row.js">
6 <include src="../../../../ui/webui/resources/js/cr/ui/focus_grid.js"> 6 <include src="../../../../ui/webui/resources/js/cr/ui/focus_grid.js">
7 <include src="../uber/uber_utils.js"> 7 <include src="../uber/uber_utils.js">
8 <include src="extension_code.js"> 8 <include src="extension_code.js">
9 <include src="extension_commands_overlay.js"> 9 <include src="extension_commands_overlay.js">
10 <include src="extension_error_overlay.js"> 10 <include src="extension_error_overlay.js">
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 pageDiv.classList.toggle('showing-banner', supervised); 333 pageDiv.classList.toggle('showing-banner', supervised);
334 334
335 var devControlsCheckbox = $('toggle-dev-on'); 335 var devControlsCheckbox = $('toggle-dev-on');
336 devControlsCheckbox.checked = extensionsData.developerMode; 336 devControlsCheckbox.checked = extensionsData.developerMode;
337 devControlsCheckbox.disabled = supervised; 337 devControlsCheckbox.disabled = supervised;
338 338
339 var instance = ExtensionSettings.getInstance(); 339 var instance = ExtensionSettings.getInstance();
340 instance.displayPromo_ = extensionsData.promoteAppsDevTools; 340 instance.displayPromo_ = extensionsData.promoteAppsDevTools;
341 instance.updateDevControlsVisibility_(false); 341 instance.updateDevControlsVisibility_(false);
342 342
343 document.documentElement.classList.add('loading');
Dan Beam 2015/04/07 17:21:13 nit: out of curiosity, why not put this...
Devlin 2015/04/07 21:14:50 Sounds good to me.
343 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled; 344 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled;
344 var extensionList = $('extension-settings-list'); 345 var extensionList = $('extension-settings-list');
345 extensionList.updateExtensionsData( 346 extensionList.updateExtensionsData(
346 extensionsData.incognitoAvailable, 347 extensionsData.incognitoAvailable,
347 extensionsData.enableAppInfoDialog).then(function() { 348 extensionsData.enableAppInfoDialog).then(function() {
348 // We can get called many times in short order, thus we need to 349 // We can get called many times in short order, thus we need to
349 // be careful to remove the 'finished loading' timeout. 350 // be careful to remove the 'finished loading' timeout.
350 if (this.loadingTimeout_) 351 if (this.loadingTimeout_)
351 window.clearTimeout(this.loadingTimeout_); 352 window.clearTimeout(this.loadingTimeout_);
352 document.documentElement.classList.add('loading');
353 this.loadingTimeout_ = window.setTimeout(function() { 353 this.loadingTimeout_ = window.setTimeout(function() {
354 document.documentElement.classList.remove('loading'); 354 document.documentElement.classList.remove('loading');
355 }, 0); 355 }, 0);
356 356
357 var hasExtensions = extensionList.getNumExtensions() != 0; 357 var hasExtensions = extensionList.getNumExtensions() != 0;
358 $('no-extensions').hidden = hasExtensions; 358 $('no-extensions').hidden = hasExtensions;
359 $('extension-list-wrapper').hidden = !hasExtensions; 359 $('extension-list-wrapper').hidden = !hasExtensions;
360 $('extension-settings-list').updateFocusableElements(); 360 $('extension-settings-list').updateFocusableElements();
361 }.bind(this)); 361 }.bind(this));
362 }; 362 };
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 '}'; 463 '}';
464 document.querySelector('head').appendChild(style); 464 document.querySelector('head').appendChild(style);
465 }; 465 };
466 466
467 // Export 467 // Export
468 return { 468 return {
469 ExtensionSettings: ExtensionSettings 469 ExtensionSettings: ExtensionSettings
470 }; 470 };
471 }); 471 });
472 472
473 window.addEventListener('load', function(e) { 473 window.addEventListener('load', function(e) {
Dan Beam 2015/04/07 17:21:13 ... here or something?
474 extensions.ExtensionSettings.getInstance().initialize(); 474 extensions.ExtensionSettings.getInstance().initialize();
475 }); 475 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698