diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 15:05:10 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-30 15:05:10 +0000 |
commit | b9c505bc4409b403aab2c67f016fbe4b01ad1509 (patch) | |
tree | 53a8b85ad11418306336d88dab1c42402b47bfd8 /chrome/browser/tab_menu_model.cc | |
parent | 298883bc55dec7bbcb59897b919d9e07691d0da9 (diff) | |
download | chromium_src-b9c505bc4409b403aab2c67f016fbe4b01ad1509.zip chromium_src-b9c505bc4409b403aab2c67f016fbe4b01ad1509.tar.gz chromium_src-b9c505bc4409b403aab2c67f016fbe4b01ad1509.tar.bz2 |
Attempt 2 at relanding your patch. I believe the problem was the removal of the observer in ~TabStrip. By the time TabStrip's destructor was run the model's destructor had already run. I've changed BrowserView to explicitly delete the TabStrip before the browser. See the change between v1 and v2 of this patch in BrowserView for the relevant part.
BUG=none
TEST=none
TBR=ben@chromium.org
Review URL: http://codereview.chromium.org/1817001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_menu_model.cc')
-rw-r--r-- | chrome/browser/tab_menu_model.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/tab_menu_model.cc b/chrome/browser/tab_menu_model.cc index bb0ba34..f955837 100644 --- a/chrome/browser/tab_menu_model.cc +++ b/chrome/browser/tab_menu_model.cc @@ -4,7 +4,9 @@ #include "chrome/browser/tab_menu_model.h" +#include "base/command_line.h" #include "chrome/browser/tabs/tab_strip_model.h" +#include "chrome/common/chrome_switches.h" #include "grit/generated_resources.h" TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, @@ -13,6 +15,16 @@ TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, Build(is_pinned); } +// static +bool TabMenuModel::AreVerticalTabsEnabled() { +#if defined(TOOLKIT_VIEWS) + return CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableVerticalTabs); +#else + return false; +#endif +} + void TabMenuModel::Build(bool is_pinned) { AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); AddSeparator(); @@ -35,4 +47,9 @@ void TabMenuModel::Build(bool is_pinned) { AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB); AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs, IDS_TAB_CXMENU_BOOKMARK_ALL_TABS); + if (AreVerticalTabsEnabled()) { + AddSeparator(); + AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs, + IDS_TAB_CXMENU_USE_VERTICAL_TABS); + } } |