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

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

Issue 1131233004: Fixes regression when opening tabs in background with pinned tabs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change comment so dont trigger copyright check Created 5 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 | « no previous file | chrome/browser/ui/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/tabs/tab_strip_model.cc
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index 08671ff46422047cf7dab27b5cb6f18005bcd170..7a751eecaf3cec5f7ad14c3af04995b664cc35b1 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -606,8 +606,12 @@ int TabStripModel::GetIndexOfLastWebContentsOpenedBy(const WebContents* opener,
for (int i = start_index + 1; i < count(); ++i) {
// Test opened by transitively, i.e. include tabs opened by tabs opened by
// opener, etc. Stop when we find the first non-descendant.
- if (!opener_and_descendants.count(contents_data_[i]->opener()))
+ if (!opener_and_descendants.count(contents_data_[i]->opener())) {
+ // Skip over pinned tabs as new tabs are added after pinned tabs.
+ if (contents_data_[i]->pinned())
+ continue;
break;
+ }
opener_and_descendants.insert(contents_data_[i]->web_contents());
last_index = i;
}
« no previous file with comments | « no previous file | chrome/browser/ui/tabs/tab_strip_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698