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

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

Issue 1094513003: Follow up for issue 462861 to make canExecute true unconditionally. (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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 case 'sort-command': 497 case 'sort-command':
498 e.canExecute = !bmm.list.isSearch() && 498 e.canExecute = !bmm.list.isSearch() &&
499 bmm.list.dataModel && bmm.list.dataModel.length > 1 && 499 bmm.list.dataModel && bmm.list.dataModel.length > 1 &&
500 !isUnmodifiable(bmm.tree.getBookmarkNodeById(bmm.list.parentId)); 500 !isUnmodifiable(bmm.tree.getBookmarkNodeById(bmm.list.parentId));
501 break; 501 break;
502 502
503 case 'undo-command': 503 case 'undo-command':
504 // Because the global undo command has no visible UI, always enable it, 504 // Because the global undo command has no visible UI, always enable it,
505 // and just make it a no-op if undo is not possible. 505 // and just make it a no-op if undo is not possible.
506 e.canExecute = e.currentTarget.activeElement !== $('term'); 506 e.canExecute = true;
507 break; 507 break;
508 508
509 default: 509 default:
510 canExecuteForList(e); 510 canExecuteForList(e);
511 if (!e.defaultPrevented) 511 if (!e.defaultPrevented)
512 canExecuteForTree(e); 512 canExecuteForTree(e);
513 break; 513 break;
514 } 514 }
515 } 515 }
516 516
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 1517
1518 cr.ui.FocusOutlineManager.forDocument(document); 1518 cr.ui.FocusOutlineManager.forDocument(document);
1519 initializeSplitter(); 1519 initializeSplitter();
1520 bmm.addBookmarkModelListeners(); 1520 bmm.addBookmarkModelListeners();
1521 dnd.init(selectItemsAfterUserAction); 1521 dnd.init(selectItemsAfterUserAction);
1522 bmm.tree.reload(); 1522 bmm.tree.reload();
1523 } 1523 }
1524 1524
1525 initializeBookmarkManager(); 1525 initializeBookmarkManager();
1526 })(); 1526 })();
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