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

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

Issue 2881183003: Add views::View::set_preferred_size, use it in a few places. (Closed)
Patch Set: auto* Created 3 years, 7 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 | « ui/views/controls/image_view.h ('k') | ui/views/view.h » ('j') | 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 c6a7145ec0592607038831f5b1bea3c14cb00587..a1ca6ee4433dc1cf6e500d9ff24325a7b04e82fd 100644
--- a/ui/views/controls/image_view.cc
+++ b/ui/views/controls/image_view.cc
@@ -77,12 +77,6 @@ void ImageView::ResetImageSize() {
image_size_set_ = false;
}
-gfx::Size ImageView::GetPreferredSize() const {
- gfx::Size size = GetImageSize();
- size.Enlarge(GetInsets().width(), GetInsets().height());
- return size;
-}
-
bool ImageView::IsImageEqual(const gfx::ImageSkia& img) const {
// Even though we copy ImageSkia in SetImage() the backing store
// (ImageSkiaStorage) is not copied and may have changed since the last call
@@ -180,6 +174,12 @@ bool ImageView::GetTooltipText(const gfx::Point& p,
return true;
}
+gfx::Size ImageView::CalculatePreferredSize() const {
+ gfx::Size size = GetImageSize();
+ size.Enlarge(GetInsets().width(), GetInsets().height());
+ return size;
+}
+
void ImageView::OnPaintImage(gfx::Canvas* canvas) {
last_paint_scale_ = canvas->image_scale();
last_painted_bitmap_pixels_ = NULL;
« no previous file with comments | « ui/views/controls/image_view.h ('k') | ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698