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

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

Issue 655143003: Don't try to create extensionoptions for extensions that don't exist. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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="extension_error.js"> 5 <include src="extension_error.js">
6 6
7 /** 7 /**
8 * The type of the extension data object. The definition is based on 8 * The type of the extension data object. The definition is based on
9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc 9 * chrome/browser/ui/webui/extensions/extension_basic_info.cc
10 * and 10 * and
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 * be displayed. 519 * be displayed.
520 * @param {boolean} scroll Whether the page should scroll to the extension 520 * @param {boolean} scroll Whether the page should scroll to the extension
521 * @private 521 * @private
522 */ 522 */
523 showEmbeddedExtensionOptions_: function(extensionId, scroll) { 523 showEmbeddedExtensionOptions_: function(extensionId, scroll) {
524 if (this.optionsShown_) 524 if (this.optionsShown_)
525 return; 525 return;
526 526
527 // Get the extension from the given id. 527 // Get the extension from the given id.
528 var extension = this.data_.extensions.filter(function(extension) { 528 var extension = this.data_.extensions.filter(function(extension) {
529 return extension.id == extensionId; 529 return extension.enabled && extension.id == extensionId;
530 })[0]; 530 })[0];
531 531
532 if (!extension) 532 if (!extension)
533 return; 533 return;
534 534
535 if (scroll) 535 if (scroll)
536 this.scrollToNode_(extensionId); 536 this.scrollToNode_(extensionId);
537 // Add the options query string. Corner case: the 'options' query string 537 // Add the options query string. Corner case: the 'options' query string
538 // will clobber the 'id' query string if the options link is clicked when 538 // will clobber the 'id' query string if the options link is clicked when
539 // 'id' is in the URL, or if both query strings are in the URL. 539 // 'id' is in the URL, or if both query strings are in the URL.
540 uber.replaceState({}, '?options=' + extensionId); 540 uber.replaceState({}, '?options=' + extensionId);
541 541
542 extensions.ExtensionOptionsOverlay.getInstance(). 542 extensions.ExtensionOptionsOverlay.getInstance().
543 setExtensionAndShowOverlay(extensionId, 543 setExtensionAndShowOverlay(extensionId,
544 extension.name, 544 extension.name,
545 extension.icon); 545 extension.icon);
546 546
547 this.optionsShown_ = true; 547 this.optionsShown_ = true;
548 $('overlay').addEventListener('cancelOverlay', function() { 548 $('overlay').addEventListener('cancelOverlay', function() {
549 this.optionsShown_ = false; 549 this.optionsShown_ = false;
550 }.bind(this)); 550 }.bind(this));
551 }, 551 },
552 }; 552 };
553 553
554 return { 554 return {
555 ExtensionsList: ExtensionsList 555 ExtensionsList: ExtensionsList
556 }; 556 };
557 }); 557 });
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_webui_apitest.cc ('k') | chrome/test/data/extensions/webui/can_embed_extension_options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698