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

Side by Side Diff: chrome/browser/ui/views/tabs/base_tab_strip.cc

Issue 6599017: Don't repaint tab when TabRenderData hasn't changed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/tabs/base_tab_strip.h" 5 #include "chrome/browser/ui/views/tabs/base_tab_strip.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/ui/view_ids.h" 8 #include "chrome/browser/ui/view_ids.h"
9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h" 9 #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h" 10 #include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 168
169 tab_data_.insert(tab_data_.begin() + to_tab_data_index, data); 169 tab_data_.insert(tab_data_.begin() + to_tab_data_index, data);
170 170
171 StartMoveTabAnimation(); 171 StartMoveTabAnimation();
172 } 172 }
173 173
174 void BaseTabStrip::SetTabData(int model_index, const TabRendererData& data) { 174 void BaseTabStrip::SetTabData(int model_index, const TabRendererData& data) {
175 BaseTab* tab = GetBaseTabAtModelIndex(model_index); 175 BaseTab* tab = GetBaseTabAtModelIndex(model_index);
176 bool mini_state_changed = tab->data().mini != data.mini; 176 bool mini_state_changed = tab->data().mini != data.mini;
177 tab->SetData(data); 177 tab->SetData(data);
178 tab->SchedulePaint();
179 178
180 if (mini_state_changed) { 179 if (mini_state_changed) {
181 if (GetWindow() && GetWindow()->IsVisible()) 180 if (GetWindow() && GetWindow()->IsVisible())
182 StartMiniTabAnimation(); 181 StartMiniTabAnimation();
183 else 182 else
184 DoLayout(); 183 DoLayout();
185 } 184 }
186 } 185 }
187 186
188 BaseTab* BaseTabStrip::GetBaseTabAtModelIndex(int model_index) const { 187 BaseTab* BaseTabStrip::GetBaseTabAtModelIndex(int model_index) const {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 487
489 StopAnimating(false); 488 StopAnimating(false);
490 489
491 GenerateIdealBounds(); 490 GenerateIdealBounds();
492 491
493 for (int i = 0; i < tab_count(); ++i) 492 for (int i = 0; i < tab_count(); ++i)
494 tab_data_[i].tab->SetBoundsRect(tab_data_[i].ideal_bounds); 493 tab_data_[i].tab->SetBoundsRect(tab_data_[i].ideal_bounds);
495 494
496 SchedulePaint(); 495 SchedulePaint();
497 } 496 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698