OLD | NEW |
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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 case 'cut-command': | 628 case 'cut-command': |
629 e.canExecute = canCopyItems() && canEdit && | 629 e.canExecute = canCopyItems() && canEdit && |
630 !hasUnmodifiable(bmm.list.selectedItems); | 630 !hasUnmodifiable(bmm.list.selectedItems); |
631 break; | 631 break; |
632 | 632 |
633 case 'copy-command': | 633 case 'copy-command': |
634 e.canExecute = canCopyItems(); | 634 e.canExecute = canCopyItems(); |
635 break; | 635 break; |
636 | 636 |
637 case 'open-in-same-window-command': | 637 case 'open-in-same-window-command': |
638 e.canExecute = hasSelected(); | 638 e.canExecute = (e.target == bmm.list) && hasSelected(); |
639 break; | 639 break; |
640 | 640 |
641 default: | 641 default: |
642 canExecuteShared(e, isSearch()); | 642 canExecuteShared(e, isSearch()); |
643 } | 643 } |
644 } | 644 } |
645 | 645 |
646 // Update canExecute for the commands when the list is the active element. | 646 // Update canExecute for the commands when the list is the active element. |
647 function handleCanExecuteForList(e) { | 647 function handleCanExecuteForList(e) { |
648 if (e.target != bmm.list) return; | 648 if (e.target != bmm.list) return; |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 })(); |
OLD | NEW |