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

Unified Diff: ui/views/controls/image_view.cc

Issue 9877009: Two tweaks to avoid invoking ShelfLayoutManager::LayoutShelf unless we (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/status_area_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/image_view.cc
diff --git a/ui/views/controls/image_view.cc b/ui/views/controls/image_view.cc
index 92c15136da17f307e9b3ebc9259f246494f2146d..100657e9c9d6ded7f199739354028dcfb72b0eac 100644
--- a/ui/views/controls/image_view.cc
+++ b/ui/views/controls/image_view.cc
@@ -23,8 +23,10 @@ ImageView::~ImageView() {
}
void ImageView::SetImage(const SkBitmap& bm) {
+ gfx::Size pref_size(GetPreferredSize());
image_ = bm;
- PreferredSizeChanged();
+ if (pref_size != GetPreferredSize())
+ PreferredSizeChanged();
SchedulePaint();
}
« no previous file with comments | « ash/wm/status_area_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698