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

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: Created 9 years, 8 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
Index: chrome/browser/ui/tabs/tab_menu_model.cc
diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc
index 28b58f59d2f8ce91006a53c8b30ea602d89b662a..e33f2c5fe57c23dce88c38c16f95edf1e2e2add2 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::IsCompactNavigationBarEnabled() {
+#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() || IsCompactNavigationBarEnabled()) {
AddSeparator();
- AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
- IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ if (AreVerticalTabsEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
+ IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ }
+ if (IsCompactNavigationBarEnabled()) {
+ 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() || IsCompactNavigationBarEnabled()) {
AddSeparator();
- AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
- IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ if (AreVerticalTabsEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseVerticalTabs,
+ IDS_TAB_CXMENU_USE_VERTICAL_TABS);
+ }
+ if (IsCompactNavigationBarEnabled()) {
+ AddCheckItemWithStringId(TabStripModel::CommandUseCompactNavigationBar,
+ IDS_TAB_CXMENU_USE_COMPACT_NAVIGATION_BAR);
+ }
}
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableTabGroupsContextMenu)) {

Powered by Google App Engine
This is Rietveld 408576698