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

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

Issue 1566313002: Remove layout during paint in Tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab.cc
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 8313719bd8881a6c1db6df5af3d1ee5abd372b52..32a774bfd2da7374ba5d08aacf25c72135a6638c 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -545,6 +545,9 @@ bool Tab::IsActive() const {
void Tab::ActiveStateChanged() {
OnButtonColorMaybeChanged();
media_indicator_button_->UpdateEnabledForMuteToggle();
+
+ if (ShouldShowCloseBox() != showing_close_button_)
miu 2016/01/08 00:25:39 I think we have to unconditionally call Layout() h
enne (OOO) 2016/01/08 01:46:25 Thanks! Updated the patch.
+ Layout();
}
bool Tab::IsSelected() const {
@@ -1176,18 +1179,9 @@ void Tab::DataChanged(const TabRendererData& old) {
}
void Tab::PaintTab(gfx::Canvas* canvas) {
- // See if the model changes whether the icons should be painted.
- const bool show_icon = ShouldShowIcon();
- const bool show_media_indicator = ShouldShowMediaIndicator();
- const bool show_close_button = ShouldShowCloseBox();
- if (show_icon != showing_icon_ ||
- show_media_indicator != showing_media_indicator_ ||
- show_close_button != showing_close_button_)
- Layout();
-
PaintTabBackground(canvas);
- if (show_icon)
+ if (showing_icon_)
PaintIcon(canvas);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698