summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/tabs/tab_menu_model.cc
diff options
context:
space:
mode:
authorstevet@chromium.org <stevet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 19:28:50 +0000
committerstevet@chromium.org <stevet@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 19:28:50 +0000
commitb584fb90f233ce696c9e1f26a306e4e13af78a56 (patch)
treeb375031588f8ab04eca6707227774901bac33674 /chrome/browser/ui/tabs/tab_menu_model.cc
parent08873a8668f8ec74d3f7ccb7f64971b11d57176c (diff)
downloadchromium_src-b584fb90f233ce696c9e1f26a306e4e13af78a56.zip
chromium_src-b584fb90f233ce696c9e1f26a306e4e13af78a56.tar.gz
chromium_src-b584fb90f233ce696c9e1f26a306e4e13af78a56.tar.bz2
The initial prototype code for the compact navigation (cnav) prototype, currently only active in windows. This is well hidden behind a flag and a context menu option.
Loosely based off oshima's original prototype patch: http://codereview.chromium.org/165272 BUG=None TEST=Activate the cnav prototype in about:flags. Right click a tab and select "Hide Toolbar" to go into cnav mode. Ensure that the compact location bar provides the same basic functionality as the toolbar (except browser actions). Review URL: http://codereview.chromium.org/6913026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/tabs/tab_menu_model.cc')
-rw-r--r--chrome/browser/ui/tabs/tab_menu_model.cc34
1 files changed, 28 insertions, 6 deletions
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
index 28b58f5..4e89731 100644
--- a/chrome/browser/ui/tabs/tab_menu_model.cc
+++ b/chrome/browser/ui/tabs/tab_menu_model.cc
@@ -32,6 +32,16 @@ bool TabMenuModel::AreVerticalTabsEnabled() {
#endif
}
+bool TabMenuModel::IsCompactNavigationModeEnabled() {
+#if defined(TOOLKIT_VIEWS)
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableCompactNavigation);
+#else
+ return false;
+#endif
+}
+
+
void TabMenuModel::Build(bool is_pinned) {
AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB);
AddSeparator();
@@ -52,10 +62,16 @@ void TabMenuModel::Build(bool is_pinned) {
AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB);
AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs,
IDS_TAB_CXMENU_BOOKMARK_ALL_TABS);
- if (AreVerticalTabsEnabled()) {
+ if (AreVerticalTabsEnabled() || IsCompactNavigationModeEnabled()) {
AddSeparator();
- AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
- IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ if (AreVerticalTabsEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
+ IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ }
+ if (IsCompactNavigationModeEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseCompactNavigationBar,
+ IDS_TAB_CXMENU_USE_COMPACT_NAVIGATION_BAR);
+ }
}
}
@@ -94,10 +110,16 @@ void TabMenuModel::Build(TabStripModel* tab_strip, int index) {
AddItemWithStringId(TabStripModel::CommandRestoreTab, IDS_RESTORE_TAB);
AddItemWithStringId(TabStripModel::CommandBookmarkAllTabs,
IDS_TAB_CXMENU_BOOKMARK_ALL_TABS);
- if (AreVerticalTabsEnabled()) {
+ if (AreVerticalTabsEnabled() || IsCompactNavigationModeEnabled()) {
AddSeparator();
- AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
- IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ if (AreVerticalTabsEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
+ IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ }
+ if (IsCompactNavigationModeEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseCompactNavigationBar,
+ IDS_TAB_CXMENU_USE_COMPACT_NAVIGATION_BAR);
+ }
}
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableTabGroupsContextMenu)) {