| 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 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** @const */ var BookmarkList = bmm.BookmarkList; | 8 /** @const */ var BookmarkList = bmm.BookmarkList; |
| 9 /** @const */ var BookmarkTree = bmm.BookmarkTree; | 9 /** @const */ var BookmarkTree = bmm.BookmarkTree; |
| 10 /** @const */ var Command = cr.ui.Command; | 10 /** @const */ var Command = cr.ui.Command; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 var performGlobalUndo; | 37 var performGlobalUndo; |
| 38 | 38 |
| 39 /** | 39 /** |
| 40 * Holds a link controller singleton. Use getLinkController() rarther than | 40 * Holds a link controller singleton. Use getLinkController() rarther than |
| 41 * accessing this variabie. | 41 * accessing this variabie. |
| 42 * @type {cr.LinkController} | 42 * @type {cr.LinkController} |
| 43 */ | 43 */ |
| 44 var linkController; | 44 var linkController; |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * New Windows are not allowed in Windows 8 metro mode. | |
| 48 */ | |
| 49 var canOpenNewWindows = true; | |
| 50 | |
| 51 /** | |
| 52 * Incognito mode availability can take the following values: , | 47 * Incognito mode availability can take the following values: , |
| 53 * - 'enabled' for when both normal and incognito modes are available; | 48 * - 'enabled' for when both normal and incognito modes are available; |
| 54 * - 'disabled' for when incognito mode is disabled; | 49 * - 'disabled' for when incognito mode is disabled; |
| 55 * - 'forced' for when incognito mode is forced (normal mode is unavailable). | 50 * - 'forced' for when incognito mode is forced (normal mode is unavailable). |
| 56 */ | 51 */ |
| 57 var incognitoModeAvailability = 'enabled'; | 52 var incognitoModeAvailability = 'enabled'; |
| 58 | 53 |
| 59 /** | 54 /** |
| 60 * Whether bookmarks can be modified. | 55 * Whether bookmarks can be modified. |
| 61 * @type {boolean} | 56 * @type {boolean} |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 break; | 565 break; |
| 571 | 566 |
| 572 case 'open-in-background-tab-command': | 567 case 'open-in-background-tab-command': |
| 573 updateOpenCommand(e, command, '', '', false); | 568 updateOpenCommand(e, command, '', '', false); |
| 574 break; | 569 break; |
| 575 | 570 |
| 576 case 'open-in-new-window-command': | 571 case 'open-in-new-window-command': |
| 577 updateOpenCommand(e, command, | 572 updateOpenCommand(e, command, |
| 578 'open_in_new_window', 'open_all_new_window', | 573 'open_in_new_window', 'open_all_new_window', |
| 579 // Disabled when incognito is forced. | 574 // Disabled when incognito is forced. |
| 580 incognitoModeAvailability == 'forced' || !canOpenNewWindows); | 575 incognitoModeAvailability == 'forced'); |
| 581 break; | 576 break; |
| 582 | 577 |
| 583 case 'open-incognito-window-command': | 578 case 'open-incognito-window-command': |
| 584 updateOpenCommand(e, command, | 579 updateOpenCommand(e, command, |
| 585 'open_incognito', 'open_all_incognito', | 580 'open_incognito', 'open_all_incognito', |
| 586 // Not available when incognito is disabled. | 581 // Not available when incognito is disabled. |
| 587 incognitoModeAvailability == 'disabled'); | 582 incognitoModeAvailability == 'disabled'); |
| 588 break; | 583 break; |
| 589 | 584 |
| 590 case 'undo-delete-command': | 585 case 'undo-delete-command': |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1529 chrome.bookmarkManagerPrivate.canEdit(function(result) { | 1524 chrome.bookmarkManagerPrivate.canEdit(function(result) { |
| 1530 canEdit = result; | 1525 canEdit = result; |
| 1531 }); | 1526 }); |
| 1532 | 1527 |
| 1533 chrome.systemPrivate.getIncognitoModeAvailability(function(result) { | 1528 chrome.systemPrivate.getIncognitoModeAvailability(function(result) { |
| 1534 // TODO(rustema): propagate policy value to the bookmark manager when it | 1529 // TODO(rustema): propagate policy value to the bookmark manager when it |
| 1535 // changes. | 1530 // changes. |
| 1536 incognitoModeAvailability = result; | 1531 incognitoModeAvailability = result; |
| 1537 }); | 1532 }); |
| 1538 | 1533 |
| 1539 chrome.bookmarkManagerPrivate.canOpenNewWindows(function(result) { | |
| 1540 canOpenNewWindows = result; | |
| 1541 }); | |
| 1542 | |
| 1543 cr.ui.FocusOutlineManager.forDocument(document); | 1534 cr.ui.FocusOutlineManager.forDocument(document); |
| 1544 initializeSplitter(); | 1535 initializeSplitter(); |
| 1545 bmm.addBookmarkModelListeners(); | 1536 bmm.addBookmarkModelListeners(); |
| 1546 dnd.init(selectItemsAfterUserAction); | 1537 dnd.init(selectItemsAfterUserAction); |
| 1547 bmm.tree.reload(); | 1538 bmm.tree.reload(); |
| 1548 } | 1539 } |
| 1549 | 1540 |
| 1550 initializeBookmarkManager(); | 1541 initializeBookmarkManager(); |
| 1551 })(); | 1542 })(); |
| OLD | NEW |