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 CommandBinding = cr.ui.CommandBinding; | 9 /** @const */ var CommandBinding = cr.ui.CommandBinding; |
10 /** @const */ var LinkKind = cr.LinkKind; | 10 /** @const */ var LinkKind = cr.LinkKind; |
(...skipping 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 undoDelete(); | 1690 undoDelete(); |
1691 break; | 1691 break; |
1692 } | 1692 } |
1693 } | 1693 } |
1694 | 1694 |
1695 // Execute the copy, cut and paste commands when those events are dispatched by | 1695 // Execute the copy, cut and paste commands when those events are dispatched by |
1696 // the browser. This allows us to rely on the browser to handle the keyboard | 1696 // the browser. This allows us to rely on the browser to handle the keyboard |
1697 // shortcuts for these commands. | 1697 // shortcuts for these commands. |
1698 function installEventHandlerForCommand(eventName, commandId) { | 1698 function installEventHandlerForCommand(eventName, commandId) { |
1699 function handle(e) { | 1699 function handle(e) { |
1700 if (document.activeElement != list || document.activeElement != tree) | 1700 if (document.activeElement != list && document.activeElement != tree) |
1701 return; | 1701 return; |
1702 var command = $(commandId); | 1702 var command = $(commandId); |
1703 if (!command.disabled) { | 1703 if (!command.disabled) { |
1704 command.execute(); | 1704 command.execute(); |
1705 if (e) | 1705 if (e) |
1706 e.preventDefault(); // Prevent the system beep. | 1706 e.preventDefault(); // Prevent the system beep. |
1707 } | 1707 } |
1708 } | 1708 } |
1709 if (eventName == 'paste') { | 1709 if (eventName == 'paste') { |
1710 // Paste is a bit special since we need to do an async call to see if we | 1710 // Paste is a bit special since we need to do an async call to see if we |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1814 }); | 1814 }); |
1815 | 1815 |
1816 initializeSplitter(); | 1816 initializeSplitter(); |
1817 bmm.addBookmarkModelListeners(); | 1817 bmm.addBookmarkModelListeners(); |
1818 dnd.init(); | 1818 dnd.init(); |
1819 tree.reload(); | 1819 tree.reload(); |
1820 } | 1820 } |
1821 | 1821 |
1822 initializeBookmarkManager(); | 1822 initializeBookmarkManager(); |
1823 })(); | 1823 })(); |
OLD | NEW |