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

Side by Side Diff: chrome/browser/resources/bookmark_manager/js/main.js

Issue 1089163002: Pressing 'Delete' key in bookmark manager's search box deletes bookmark. (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
« 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 (function() { 5 (function() {
6 /** @const */ var BookmarkList = bmm.BookmarkList; 6 /** @const */ var BookmarkList = bmm.BookmarkList;
7 /** @const */ var BookmarkTree = bmm.BookmarkTree; 7 /** @const */ var BookmarkTree = bmm.BookmarkTree;
8 /** @const */ var Command = cr.ui.Command; 8 /** @const */ var Command = cr.ui.Command;
9 /** @const */ var LinkKind = cr.LinkKind; 9 /** @const */ var LinkKind = cr.LinkKind;
10 /** @const */ var ListItem = cr.ui.ListItem; 10 /** @const */ var ListItem = cr.ui.ListItem;
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 break; 489 break;
490 490
491 case 'undo-command': 491 case 'undo-command':
492 // If the search box is active, pass the undo command through 492 // If the search box is active, pass the undo command through
493 // (fixes http://crbug.com/278112). Otherwise, because 493 // (fixes http://crbug.com/278112). Otherwise, because
494 // the global undo command has no visible UI, always enable it, and 494 // the global undo command has no visible UI, always enable it, and
495 // just make it a no-op if undo is not possible. 495 // just make it a no-op if undo is not possible.
496 e.canExecute = e.currentTarget.activeElement !== $('term'); 496 e.canExecute = e.currentTarget.activeElement !== $('term');
497 break; 497 break;
498 498
499 case 'delete-command':
500 // If the search box is active, pass the delete command
501 e.canExecute = e.currentTarget.activeElement !== $('term');
Bernhard Bauer 2015/04/15 12:51:16 Right. This means however that we will always make
502 break;
503
499 default: 504 default:
500 canExecuteForList(e); 505 canExecuteForList(e);
501 if (!e.defaultPrevented) 506 if (!e.defaultPrevented)
502 canExecuteForTree(e); 507 canExecuteForTree(e);
503 break; 508 break;
504 } 509 }
505 } 510 }
506 511
507 /** 512 /**
508 * Helper function for handling canExecute for the list and the tree. 513 * Helper function for handling canExecute for the list and the tree.
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 1511
1507 cr.ui.FocusOutlineManager.forDocument(document); 1512 cr.ui.FocusOutlineManager.forDocument(document);
1508 initializeSplitter(); 1513 initializeSplitter();
1509 bmm.addBookmarkModelListeners(); 1514 bmm.addBookmarkModelListeners();
1510 dnd.init(selectItemsAfterUserAction); 1515 dnd.init(selectItemsAfterUserAction);
1511 bmm.tree.reload(); 1516 bmm.tree.reload();
1512 } 1517 }
1513 1518
1514 initializeBookmarkManager(); 1519 initializeBookmarkManager();
1515 })(); 1520 })();
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