diff options
Diffstat (limited to 'chrome/browser/tab_menu_model.cc')
-rw-r--r-- | chrome/browser/tab_menu_model.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/tab_menu_model.cc b/chrome/browser/tab_menu_model.cc index 6b8dc17..41667b2 100644 --- a/chrome/browser/tab_menu_model.cc +++ b/chrome/browser/tab_menu_model.cc @@ -10,9 +10,11 @@ #include "grit/generated_resources.h" TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, - bool is_pinned) + bool is_pinned, + bool allow_toolbar_toggle, + bool is_toolbar_visible) : menus::SimpleMenuModel(delegate) { - Build(is_pinned); + Build(is_pinned, allow_toolbar_toggle, is_toolbar_visible); } // static @@ -27,7 +29,8 @@ bool TabMenuModel::AreVerticalTabsEnabled() { #endif } -void TabMenuModel::Build(bool is_pinned) { +void TabMenuModel::Build(bool is_pinned, bool allow_toolbar_toggle, + bool is_toolbar_visible) { AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); AddSeparator(); AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); @@ -36,6 +39,12 @@ void TabMenuModel::Build(bool is_pinned) { AddItemWithStringId( TabStripModel::CommandTogglePinned, is_pinned ? IDS_TAB_CXMENU_UNPIN_TAB : IDS_TAB_CXMENU_PIN_TAB); + if (allow_toolbar_toggle) { + AddItemWithStringId( + TabStripModel::CommandToggleToolbar, + is_toolbar_visible ? IDS_TAB_CXMENU_HIDE_TOOLBAR : + IDS_TAB_CXMENU_SHOW_TOOLBAR); + } AddSeparator(); AddItemWithStringId(TabStripModel::CommandCloseTab, IDS_TAB_CXMENU_CLOSETAB); |