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

Unified Diff: chrome/browser/ui/views/tabs/tab_strip.cc

Issue 1566313002: Remove layout during paint in Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extraneous changes Created 4 years, 11 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/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_strip.cc
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 151d264d72d7cd81fb921b09fc78001886907fbe..88356d54d2ef74821ef69b4d39c942f6e0af287d 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -728,6 +728,9 @@ void TabStrip::SetStackedLayout(bool stacked_layout) {
active_center - ideal_bounds(active_index).width() / 2);
AnimateToIdealBounds();
}
+
+ for (int i = 0; i < tab_count(); ++i)
+ tab_at(i)->Layout();
sky 2016/01/12 22:29:11 Can you elaborate as to why this is necessary (and
enne (OOO) 2016/01/12 22:36:28 Changing stacked layout can change whether or not
sky 2016/01/12 22:41:02 Yes, because the animation triggers layout.
}
gfx::Rect TabStrip::GetNewTabButtonBounds() {
@@ -1143,9 +1146,17 @@ bool TabStrip::ShouldHideCloseButtonForInactiveTabs() {
}
void TabStrip::SelectTab(Tab* tab) {
+ int old_active = controller_->GetActiveIndex();
sky 2016/01/12 22:29:11 How come TabStrip::SetSelection doesn't cover this
enne (OOO) 2016/01/12 22:36:29 SelectTab and SetSelection are both public functio
sky 2016/01/12 22:41:02 SelectTab calls to the TabStripController, which s
enne (OOO) 2016/01/12 22:54:54 It does not appear to call SetSelection from the t
sky 2016/01/13 00:41:09 Please update the caller to do that then as that i
+
int model_index = GetModelIndexOfTab(tab);
if (IsValidModelIndex(model_index))
controller_->SelectTab(model_index);
+
+ int new_active = controller_->GetActiveIndex();
+ if (new_active != old_active) {
+ tab_at(old_active)->ActiveStateChanged();
+ tab_at(new_active)->ActiveStateChanged();
+ }
}
void TabStrip::ExtendSelectionTo(Tab* tab) {
« no previous file with comments | « chrome/browser/ui/views/tabs/tab.cc ('k') | chrome/browser/ui/views/tabs/tab_strip_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698