| OLD | NEW |
| 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 #ifndef UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ |
| 6 #define UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/gfx/image/image_skia.h" | 10 #include "ui/gfx/image/image_skia.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 ~ImageView() override; | 43 ~ImageView() override; |
| 44 | 44 |
| 45 // Set the image that should be displayed. | 45 // Set the image that should be displayed. |
| 46 void SetImage(const gfx::ImageSkia& img); | 46 void SetImage(const gfx::ImageSkia& img); |
| 47 | 47 |
| 48 // Set the image that should be displayed from a pointer. Reset the image | 48 // Set the image that should be displayed from a pointer. Reset the image |
| 49 // if the pointer is NULL. The pointer contents is copied in the receiver's | 49 // if the pointer is NULL. The pointer contents is copied in the receiver's |
| 50 // image. | 50 // image. |
| 51 void SetImage(const gfx::ImageSkia* image_skia); | 51 void SetImage(const gfx::ImageSkia* image_skia); |
| 52 | 52 |
| 53 // Returns the image currently displayed or NULL of none is currently set. | 53 // Returns the image currently displayed, which can be empty if not set. |
| 54 // The returned image is still owned by the ImageView. | 54 // The returned image is still owned by the ImageView. |
| 55 const gfx::ImageSkia& GetImage(); | 55 const gfx::ImageSkia& GetImage() const; |
| 56 | 56 |
| 57 // Set the desired image size for the receiving ImageView. | 57 // Set the desired image size for the receiving ImageView. |
| 58 void SetImageSize(const gfx::Size& image_size); | 58 void SetImageSize(const gfx::Size& image_size); |
| 59 | 59 |
| 60 // Returns the actual bounds of the visible image inside the view. | 60 // Returns the actual bounds of the visible image inside the view. |
| 61 gfx::Rect GetImageBounds() const; | 61 gfx::Rect GetImageBounds() const; |
| 62 | 62 |
| 63 // Reset the image size to the current image dimensions. | 63 // Reset the image size to the current image dimensions. |
| 64 void ResetImageSize(); | 64 void ResetImageSize(); |
| 65 | 65 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void* last_painted_bitmap_pixels_; | 134 void* last_painted_bitmap_pixels_; |
| 135 | 135 |
| 136 scoped_ptr<views::Painter> focus_painter_; | 136 scoped_ptr<views::Painter> focus_painter_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(ImageView); | 138 DISALLOW_COPY_AND_ASSIGN(ImageView); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace views | 141 } // namespace views |
| 142 | 142 |
| 143 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ | 143 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ |
| OLD | NEW |