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

Unified Diff: chrome/browser/tabs/tab_strip_model_order_controller.cc

Issue 155228: Adds tab pinning to TabStripModel. This is just the model side of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 5 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_order_controller.cc
===================================================================
--- chrome/browser/tabs/tab_strip_model_order_controller.cc (revision 20158)
+++ chrome/browser/tabs/tab_strip_model_order_controller.cc (working copy)
@@ -24,6 +24,7 @@
PageTransition::Type transition,
bool foreground) {
int tab_count = tabstrip_->count();
+ int first_non_pinned_tab = tabstrip_->IndexOfFirstNonPinnedTab();
if (!tab_count)
return 0;
@@ -33,7 +34,8 @@
// tab, insert it adjacent to the tab that opened that link.
// TODO(beng): (http://b/1085481) may want to open right of all locked
// tabs?
- return tabstrip_->selected_index() + 1;
+ return std::max(first_non_pinned_tab,
+ tabstrip_->selected_index() + 1);
}
NavigationController* opener =
&tabstrip_->GetSelectedTabContents()->controller();
@@ -44,7 +46,7 @@
if (index != TabStripModel::kNoTab)
return index + 1;
// Otherwise insert adjacent to opener...
- return tabstrip_->selected_index() + 1;
+ return std::max(first_non_pinned_tab, tabstrip_->selected_index() + 1);
}
// In other cases, such as Ctrl+T, open at the end of the strip.
return tab_count;

Powered by Google App Engine
This is Rietveld 408576698