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 const BookmarkList = bmm.BookmarkList; | 5 const BookmarkList = bmm.BookmarkList; |
6 const BookmarkTree = bmm.BookmarkTree; | 6 const BookmarkTree = bmm.BookmarkTree; |
7 const ListItem = cr.ui.ListItem; | 7 const ListItem = cr.ui.ListItem; |
8 const TreeItem = cr.ui.TreeItem; | 8 const TreeItem = cr.ui.TreeItem; |
9 const LinkKind = cr.LinkKind; | 9 const LinkKind = cr.LinkKind; |
10 const Command = cr.ui.Command; | 10 const Command = cr.ui.Command; |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1453 * @param {!Event} e The event object. | 1453 * @param {!Event} e The event object. |
1454 */ | 1454 */ |
1455 function handleCommand(e) { | 1455 function handleCommand(e) { |
1456 var command = e.command; | 1456 var command = e.command; |
1457 var commandId = command.id; | 1457 var commandId = command.id; |
1458 switch (commandId) { | 1458 switch (commandId) { |
1459 case 'show-in-folder-command': | 1459 case 'show-in-folder-command': |
1460 showInFolder(); | 1460 showInFolder(); |
1461 break; | 1461 break; |
1462 case 'open-in-new-tab-command': | 1462 case 'open-in-new-tab-command': |
1463 openBookmarks(LinkKind.FOREGROUND_TAB); | |
1464 break; | |
1465 case 'open-in-background-tab-command': | 1463 case 'open-in-background-tab-command': |
1466 openBookmarks(LinkKind.BACKGROUND_TAB); | 1464 openBookmarks(LinkKind.BACKGROUND_TAB); |
1467 break; | 1465 break; |
1468 case 'open-in-new-window-command': | 1466 case 'open-in-new-window-command': |
1469 openBookmarks(LinkKind.WINDOW); | 1467 openBookmarks(LinkKind.WINDOW); |
1470 break; | 1468 break; |
1471 case 'open-incognito-window-command': | 1469 case 'open-incognito-window-command': |
1472 openBookmarks(LinkKind.INCOGNITO); | 1470 openBookmarks(LinkKind.INCOGNITO); |
1473 break; | 1471 break; |
1474 case 'delete-command': | 1472 case 'delete-command': |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 document.addEventListener('copy', handle('copy-command')); | 1547 document.addEventListener('copy', handle('copy-command')); |
1550 document.addEventListener('cut', handle('cut-command')); | 1548 document.addEventListener('cut', handle('cut-command')); |
1551 | 1549 |
1552 var pasteHandler = handle('paste-command'); | 1550 var pasteHandler = handle('paste-command'); |
1553 document.addEventListener('paste', function(e) { | 1551 document.addEventListener('paste', function(e) { |
1554 // Paste is a bit special since we need to do an async call to see if we can | 1552 // Paste is a bit special since we need to do an async call to see if we can |
1555 // paste because the paste command might not be up to date. | 1553 // paste because the paste command might not be up to date. |
1556 updatePasteCommand(pasteHandler); | 1554 updatePasteCommand(pasteHandler); |
1557 }); | 1555 }); |
1558 })(); | 1556 })(); |
OLD | NEW |