Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: chrome/browser/tab_menu_model.cc

Issue 500030: Factor tab context menu into a shared model and fix mac and win to use it. Im... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // LICENSE file.
4
5 #include "chrome/browser/tab_menu_model.h"
6
7 #include "chrome/browser/tabs/tab_strip_model.h"
8 #include "grit/generated_resources.h"
9
10 TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate)
11 : menus::SimpleMenuModel(delegate) {
12 Build();
13 }
14
15 void TabMenuModel::Build() {
16 AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB);
17 AddSeparator();
18 AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD);
19 AddItemWithStringId(TabStripModel::CommandDuplicate,
20 IDS_TAB_CXMENU_DUPLICATE);
21 // 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 #if defined(OS_MACOSX)
24 AddItemWithStringId(TabStripModel::CommandTogglePinned,
25 IDS_TAB_CXMENU_PIN_TAB);
26 #else
27 AddCheckItemWithStringId(TabStripModel::CommandTogglePinned,
28 IDS_TAB_CXMENU_PIN_TAB);
29 #endif
30 AddSeparator();
31 AddItemWithStringId(TabStripModel::CommandCloseTab,
32 IDS_TAB_CXMENU_CLOSETAB);
33 AddItemWithStringId(TabStripModel::CommandCloseOtherTabs,
34 IDS_TAB_CXMENU_CLOSEOTHERTABS);
35 AddItemWithStringId(TabStripModel::CommandCloseTabsToRight,
36 IDS_TAB_CXMENU_CLOSETABSTORIGHT);
37 AddItemWithStringId(TabStripModel::CommandCloseTabsOpenedBy,
38 IDS_TAB_CXMENU_CLOSETABSOPENEDBY);
39 AddSeparator();
40 AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB);
41 AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs,
42 IDS_TAB_CXMENU_BOOKMARK_ALL_TABS);
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698