| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/tab_menu_model.h" | 5 #include "chrome/browser/tab_menu_model.h" |
| 6 | 6 |
| 7 #include "chrome/browser/tabs/tab_strip_model.h" | 7 #include "chrome/browser/tabs/tab_strip_model.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 | 9 |
| 10 TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate) | 10 TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate) |
| 11 : menus::SimpleMenuModel(delegate) { | 11 : menus::SimpleMenuModel(delegate) { |
| 12 Build(); | 12 Build(); |
| 13 } | 13 } |
| 14 | 14 |
| 15 void TabMenuModel::Build() { | 15 void TabMenuModel::Build() { |
| 16 AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); | 16 AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); |
| 17 AddSeparator(); | 17 AddSeparator(); |
| 18 AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); | 18 AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); |
| 19 AddItemWithStringId(TabStripModel::CommandDuplicate, | 19 AddItemWithStringId(TabStripModel::CommandDuplicate, |
| 20 IDS_TAB_CXMENU_DUPLICATE); | 20 IDS_TAB_CXMENU_DUPLICATE); |
| 21 #if defined(ENABLE_PINNED_TABS) |
| 21 // On Mac the HIG prefers "pin/unpin" to a checkmark. The Mac code will fix up | 22 // On Mac the HIG prefers "pin/unpin" to a checkmark. The Mac code will fix up |
| 22 // the actual string based on the tab's state via the delegate. | 23 // the actual string based on the tab's state via the delegate. |
| 23 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
| 24 AddItemWithStringId(TabStripModel::CommandTogglePinned, | 25 AddItemWithStringId(TabStripModel::CommandTogglePinned, |
| 25 IDS_TAB_CXMENU_PIN_TAB); | 26 IDS_TAB_CXMENU_PIN_TAB); |
| 26 #else | 27 #else |
| 27 AddCheckItemWithStringId(TabStripModel::CommandTogglePinned, | 28 AddCheckItemWithStringId(TabStripModel::CommandTogglePinned, |
| 28 IDS_TAB_CXMENU_PIN_TAB); | 29 IDS_TAB_CXMENU_PIN_TAB); |
| 29 #endif | 30 #endif |
| 31 #endif |
| 30 AddSeparator(); | 32 AddSeparator(); |
| 31 AddItemWithStringId(TabStripModel::CommandCloseTab, | 33 AddItemWithStringId(TabStripModel::CommandCloseTab, |
| 32 IDS_TAB_CXMENU_CLOSETAB); | 34 IDS_TAB_CXMENU_CLOSETAB); |
| 33 AddItemWithStringId(TabStripModel::CommandCloseOtherTabs, | 35 AddItemWithStringId(TabStripModel::CommandCloseOtherTabs, |
| 34 IDS_TAB_CXMENU_CLOSEOTHERTABS); | 36 IDS_TAB_CXMENU_CLOSEOTHERTABS); |
| 35 AddItemWithStringId(TabStripModel::CommandCloseTabsToRight, | 37 AddItemWithStringId(TabStripModel::CommandCloseTabsToRight, |
| 36 IDS_TAB_CXMENU_CLOSETABSTORIGHT); | 38 IDS_TAB_CXMENU_CLOSETABSTORIGHT); |
| 37 AddItemWithStringId(TabStripModel::CommandCloseTabsOpenedBy, | 39 AddItemWithStringId(TabStripModel::CommandCloseTabsOpenedBy, |
| 38 IDS_TAB_CXMENU_CLOSETABSOPENEDBY); | 40 IDS_TAB_CXMENU_CLOSETABSOPENEDBY); |
| 39 AddSeparator(); | 41 AddSeparator(); |
| 40 AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); | 42 AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); |
| 41 AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs, | 43 AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs, |
| 42 IDS_TAB_CXMENU_BOOKMARK_ALL_TABS); | 44 IDS_TAB_CXMENU_BOOKMARK_ALL_TABS); |
| 43 } | 45 } |
| OLD | NEW |