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

Side by Side Diff: chrome/browser/ui/views/status_bubble_views.cc

Issue 60683003: A number of paint optimizations to improve overall paint times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove SetImageByResourceID and use BackedBySameObjectAs Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/status_bubble_views.h" 5 #include "chrome/browser/ui/views/status_bubble_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 ui::ThemeProvider* theme_service_; 185 ui::ThemeProvider* theme_service_;
186 }; 186 };
187 187
188 void StatusBubbleViews::StatusView::SetText(const string16& text, 188 void StatusBubbleViews::StatusView::SetText(const string16& text,
189 bool should_animate_open) { 189 bool should_animate_open) {
190 if (text.empty()) { 190 if (text.empty()) {
191 // The string was empty. 191 // The string was empty.
192 StartHiding(); 192 StartHiding();
193 } else { 193 } else {
194 // We want to show the string. 194 // We want to show the string.
195 text_ = text; 195 if (text != text_) {
196 text_ = text;
197 SchedulePaint();
198 }
196 if (should_animate_open) 199 if (should_animate_open)
197 StartShowing(); 200 StartShowing();
198 } 201 }
199
200 SchedulePaint();
201 } 202 }
202 203
203 void StatusBubbleViews::StatusView::Show() { 204 void StatusBubbleViews::StatusView::Show() {
204 Stop(); 205 Stop();
205 CancelTimer(); 206 CancelTimer();
206 SetOpacity(1.0); 207 SetOpacity(1.0);
207 popup_->Show(); 208 popup_->Show();
208 stage_ = BUBBLE_SHOWN; 209 stage_ = BUBBLE_SHOWN;
209 } 210 }
210 211
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 void StatusBubbleViews::SetBubbleWidth(int width) { 849 void StatusBubbleViews::SetBubbleWidth(int width) {
849 size_.set_width(width); 850 size_.set_width(width);
850 SetBounds(original_position_.x(), original_position_.y(), 851 SetBounds(original_position_.x(), original_position_.y(),
851 size_.width(), size_.height()); 852 size_.width(), size_.height());
852 } 853 }
853 854
854 void StatusBubbleViews::CancelExpandTimer() { 855 void StatusBubbleViews::CancelExpandTimer() {
855 if (expand_timer_factory_.HasWeakPtrs()) 856 if (expand_timer_factory_.HasWeakPtrs())
856 expand_timer_factory_.InvalidateWeakPtrs(); 857 expand_timer_factory_.InvalidateWeakPtrs();
857 } 858 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | ui/views/controls/image_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698