Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: chrome/browser/ui/tabs/tab_menu_model.cc

Issue 6913026: Compact Navigation prototype (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Clang build fix. After commit/revert. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/tabs/tab_menu_model.h ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_menu_model.cc
===================================================================
--- chrome/browser/ui/tabs/tab_menu_model.cc (revision 84869)
+++ chrome/browser/ui/tabs/tab_menu_model.cc (working copy)
@@ -32,6 +32,16 @@
#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 @@
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 @@
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)) {
« no previous file with comments | « chrome/browser/ui/tabs/tab_menu_model.h ('k') | chrome/browser/ui/view_ids.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698