diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 15:39:20 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-26 15:39:20 +0000 |
commit | 239619390b6f88dbf22733966446ea7185679e44 (patch) | |
tree | d0e20227095cc90bbec31031c3e0dd7c99c6d308 /chrome/browser/tab_menu_model.cc | |
parent | f2a14229a7a87c5fd694610ce52c1bf0b2b0f97f (diff) | |
download | chromium_src-239619390b6f88dbf22733966446ea7185679e44.zip chromium_src-239619390b6f88dbf22733966446ea7185679e44.tar.gz chromium_src-239619390b6f88dbf22733966446ea7185679e44.tar.bz2 |
Changes the tab menu to use pin and unpin instead of a check. The mac
changes to use the right thing (pinned vs mini) will be done separately.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1725006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45581 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_menu_model.cc')
-rw-r--r-- | chrome/browser/tab_menu_model.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/chrome/browser/tab_menu_model.cc b/chrome/browser/tab_menu_model.cc index d2b38ce..bb0ba34 100644 --- a/chrome/browser/tab_menu_model.cc +++ b/chrome/browser/tab_menu_model.cc @@ -4,30 +4,24 @@ #include "chrome/browser/tab_menu_model.h" -#include "chrome/browser/defaults.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "grit/generated_resources.h" -TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate) +TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, + bool is_pinned) : menus::SimpleMenuModel(delegate) { - Build(); + Build(is_pinned); } -void TabMenuModel::Build() { +void TabMenuModel::Build(bool is_pinned) { AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); AddSeparator(); AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); AddItemWithStringId(TabStripModel::CommandDuplicate, IDS_TAB_CXMENU_DUPLICATE); - // On Mac the HIG prefers "pin/unpin" to a checkmark. The Mac code will fix up - // the actual string based on the tab's state via the delegate. -#if defined(OS_MACOSX) - AddItemWithStringId(TabStripModel::CommandTogglePinned, - IDS_TAB_CXMENU_PIN_TAB); -#else - AddCheckItemWithStringId(TabStripModel::CommandTogglePinned, - IDS_TAB_CXMENU_PIN_TAB); -#endif + AddItemWithStringId( + TabStripModel::CommandTogglePinned, + is_pinned ? IDS_TAB_CXMENU_UNPIN_TAB : IDS_TAB_CXMENU_PIN_TAB); AddSeparator(); AddItemWithStringId(TabStripModel::CommandCloseTab, IDS_TAB_CXMENU_CLOSETAB); |