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

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

Issue 971993002: extensions: reinstate trash focus/closing logic after switch to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 <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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 trash.classList.add('open'); 459 trash.classList.add('open');
460 trash.classList.toggle('mouse-clicked', e.detail > 0); 460 trash.classList.toggle('mouse-clicked', e.detail > 0);
461 if (this.uninstallIsShowing_) 461 if (this.uninstallIsShowing_)
462 return; 462 return;
463 this.uninstallIsShowing_ = true; 463 this.uninstallIsShowing_ = true;
464 chrome.management.uninstall(extension.id, 464 chrome.management.uninstall(extension.id,
465 {showConfirmDialog: true}, 465 {showConfirmDialog: true},
466 function() { 466 function() {
467 // TODO(devlin): What should we do if the uninstall fails? 467 // TODO(devlin): What should we do if the uninstall fails?
468 this.uninstallIsShowing_ = false; 468 this.uninstallIsShowing_ = false;
469
470 if (trash.classList.contains('mouse-clicked'))
471 trash.blur();
472
473 if (chrome.runtime.lastError) {
474 // The uninstall failed (e.g. a cancel). Allow the trash to close.
475 trash.classList.remove('open');
476 } else {
477 // Leave the trash open if the uninstall succeded. Otherwise it can
478 // half-close right before it's removed when the DOM is modified.
479 }
469 }.bind(this)); 480 }.bind(this));
470 }.bind(this)); 481 }.bind(this));
471 row.querySelector('.enable-controls').appendChild(trash); 482 row.querySelector('.enable-controls').appendChild(trash);
472 483
473 // Developer mode //////////////////////////////////////////////////////// 484 // Developer mode ////////////////////////////////////////////////////////
474 485
475 // The path, if provided by unpacked extension. 486 // The path, if provided by unpacked extension.
476 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click', 487 row.setupColumn('.load-path a:first-of-type', 'dev-loadPath', 'click',
477 function(e) { 488 function(e) {
478 chrome.send('extensionSettingsShowPath', [String(extension.id)]); 489 chrome.send('extensionSettingsShowPath', [String(extension.id)]);
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 self.optionsShown_ = false; 903 self.optionsShown_ = false;
893 $('overlay').removeEventListener('cancelOverlay', f); 904 $('overlay').removeEventListener('cancelOverlay', f);
894 }); 905 });
895 906
896 // TODO(dbeam): why do we need to focus <extensionoptions> before and 907 // TODO(dbeam): why do we need to focus <extensionoptions> before and
897 // after its showing animation? Makes very little sense to me. 908 // after its showing animation? Makes very little sense to me.
898 overlay.setInitialFocus(); 909 overlay.setInitialFocus();
899 }, 910 },
900 }; 911 };
901 912
902 ExtensionList.uninstallCancel = function() {
903 var trash = document.querySelector('.trash.open');
904 if (trash.classList.contains('mouse-clicked'))
905 trash.blur();
906 trash.classList.remove('open');
907 };
908
909 return { 913 return {
910 ExtensionList: ExtensionList 914 ExtensionList: ExtensionList
911 }; 915 };
912 }); 916 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698