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

Unified Diff: chrome/browser/gtk/tabs/tab_strip_gtk.cc

Issue 199054: GTK: fix tabstrip index misalignment during tab removal.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove debugging code Created 11 years, 3 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 | « chrome/browser/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_strip_gtk.cc
===================================================================
--- chrome/browser/gtk/tabs/tab_strip_gtk.cc (revision 25676)
+++ chrome/browser/gtk/tabs/tab_strip_gtk.cc (working copy)
@@ -1015,7 +1015,7 @@
bool loading_only) {
// Index is in terms of the model. Need to make sure we adjust that index in
// case we have an animation going.
- TabGtk* tab = GetTabAt(index);
+ TabGtk* tab = GetTabAtAdjustForAnimation(index);
tab->UpdateData(contents, loading_only);
tab->UpdateFromModel();
}
@@ -1213,6 +1213,16 @@
return tab_data_.at(index).tab;
}
+TabGtk* TabStripGtk::GetTabAtAdjustForAnimation(int index) const {
+ if (active_animation_.get() &&
+ active_animation_->type() == TabAnimation::REMOVE &&
+ index >=
+ static_cast<RemoveTabAnimation*>(active_animation_.get())->index()) {
+ index++;
+ }
+ return GetTabAt(index);
+}
+
void TabStripGtk::RemoveTabAt(int index) {
TabGtk* removed = tab_data_.at(index).tab;
« no previous file with comments | « chrome/browser/gtk/tabs/tab_strip_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698