| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 5 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/tabs/tab_strip_model.h" | 8 #include "chrome/browser/tabs/tab_strip_model.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 bool TabMenuModel::AreVerticalTabsEnabled() { | 26 bool TabMenuModel::AreVerticalTabsEnabled() { |
| 27 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) || defined(OS_CHROMEOS) | 27 #if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 28 return CommandLine::ForCurrentProcess()->HasSwitch( | 28 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 29 switches::kEnableVerticalTabs); | 29 switches::kEnableVerticalTabs); |
| 30 #else | 30 #else |
| 31 return false; | 31 return false; |
| 32 #endif | 32 #endif |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool TabMenuModel::IsCompactNavigationModeEnabled() { | 35 bool TabMenuModel::IsCompactNavigationModeEnabled() { |
| 36 #if defined(TOOLKIT_VIEWS) | 36 // TODO(stevet): Completely remove this once we clean up the rest of the cnav |
| 37 return CommandLine::ForCurrentProcess()->HasSwitch( | 37 // code. |
| 38 switches::kEnableCompactNavigation); | |
| 39 #else | |
| 40 return false; | 38 return false; |
| 41 #endif | |
| 42 } | 39 } |
| 43 | 40 |
| 44 | 41 |
| 45 void TabMenuModel::Build(bool is_pinned) { | 42 void TabMenuModel::Build(bool is_pinned) { |
| 46 AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); | 43 AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB); |
| 47 AddSeparator(); | 44 AddSeparator(); |
| 48 AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); | 45 AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD); |
| 49 AddItemWithStringId(TabStripModel::CommandDuplicate, | 46 AddItemWithStringId(TabStripModel::CommandDuplicate, |
| 50 IDS_TAB_CXMENU_DUPLICATE); | 47 IDS_TAB_CXMENU_DUPLICATE); |
| 51 AddItemWithStringId( | 48 AddItemWithStringId( |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 120 } |
| 124 if (CommandLine::ForCurrentProcess()->HasSwitch( | 121 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 125 switches::kEnableTabGroupsContextMenu)) { | 122 switches::kEnableTabGroupsContextMenu)) { |
| 126 AddSeparator(); | 123 AddSeparator(); |
| 127 AddItemWithStringId(TabStripModel::CommandSelectByDomain, | 124 AddItemWithStringId(TabStripModel::CommandSelectByDomain, |
| 128 IDS_TAB_CXMENU_SELECT_BY_DOMAIN); | 125 IDS_TAB_CXMENU_SELECT_BY_DOMAIN); |
| 129 AddItemWithStringId(TabStripModel::CommandSelectByOpener, | 126 AddItemWithStringId(TabStripModel::CommandSelectByOpener, |
| 130 IDS_TAB_CXMENU_SELECT_BY_OPENER); | 127 IDS_TAB_CXMENU_SELECT_BY_OPENER); |
| 131 } | 128 } |
| 132 } | 129 } |
| OLD | NEW |