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

Unified Diff: chrome/browser/tabs/tab_strip_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/tabs/tab_strip_model.cc
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index fa632afe9de249fa54208bead086df84e04be759..07f24d0b9ea4f22bc73042514f22f0d25eb8e13d 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -711,6 +711,10 @@ void TabStripModel::MoveTabPrevious() {
MoveTabContentsAt(active_index(), new_index, true);
}
+void TabStripModel::TabReselected(int index) {
+ FOR_EACH_OBSERVER(TabStripModelObserver, observers_, TabReselected(index));
+}
+
// Context menu functions.
bool TabStripModel::IsContextMenuCommandEnabled(
int context_index, ContextMenuCommand command_id) const {
@@ -764,6 +768,7 @@ bool TabStripModel::IsContextMenuCommandEnabled(
delegate_->CanBookmarkAllTabs();
case CommandUseVerticalTabs:
+ case CommandUseCompactNavigationBar:
return true;
case CommandSelectByDomain:
@@ -782,6 +787,8 @@ bool TabStripModel::IsContextMenuCommandChecked(
switch (command_id) {
case CommandUseVerticalTabs:
return delegate()->UseVerticalTabs();
+ case CommandUseCompactNavigationBar:
+ return delegate()->UseCompactNavigationBar();
default:
NOTREACHED();
break;
@@ -904,6 +911,14 @@ void TabStripModel::ExecuteContextMenuCommand(
break;
}
+ case CommandUseCompactNavigationBar: {
+ UserMetrics::RecordAction(
+ UserMetricsAction("TabContextMenu_CompactNavigationBar"));
+
+ delegate()->ToggleUseCompactNavigationBar();
+ break;
+ }
+
case CommandSelectByDomain:
case CommandSelectByOpener: {
std::vector<int> indices;
@@ -1029,6 +1044,9 @@ bool TabStripModel::ContextMenuCommandToBrowserCommand(int cmd_id,
case CommandUseVerticalTabs:
*browser_cmd = IDC_TOGGLE_VERTICAL_TABS;
break;
+ case CommandUseCompactNavigationBar:
+ *browser_cmd = IDC_COMPACT_NAVBAR;
+ break;
default:
*browser_cmd = 0;
return false;

Powered by Google App Engine
This is Rietveld 408576698