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

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

Issue 376018: Fix jumping/resize/relayout of NTP/webpages when switching between NTP and an... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/views/frame/browser_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tabs/tab_strip_model.cc
===================================================================
--- chrome/browser/tabs/tab_strip_model.cc (revision 30243)
+++ chrome/browser/tabs/tab_strip_model.cc (working copy)
@@ -107,15 +107,17 @@
}
contents_data_.insert(contents_data_.begin() + index, data);
+ if (index <= selected_index_) {
+ // If a tab is inserted before the current selected index,
+ // then |selected_index| needs to be incremented.
+ ++selected_index_;
+ }
+
FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
TabInsertedAt(contents, index, foreground));
if (foreground) {
ChangeSelectedContentsFrom(selected_contents, index, false);
- } else if (index <= selected_index_) {
- // If a tab is inserted before the current selected index that is not
- // foreground, |selected_index| needs to be incremented.
- ++selected_index_;
}
}
« no previous file with comments | « no previous file | chrome/browser/views/frame/browser_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698