| OLD | NEW |
| 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "ui/gfx/image/image_skia.h" |
| 10 #include "ui/views/view.h" | 11 #include "ui/views/view.h" |
| 11 | 12 |
| 12 namespace gfx { | 13 namespace gfx { |
| 13 class Canvas; | 14 class Canvas; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace views { | 17 namespace views { |
| 17 | 18 |
| 18 ///////////////////////////////////////////////////////////////////////////// | 19 ///////////////////////////////////////////////////////////////////////////// |
| 19 // | 20 // |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 CENTER, | 33 CENTER, |
| 33 TRAILING | 34 TRAILING |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 ImageView(); | 37 ImageView(); |
| 37 virtual ~ImageView(); | 38 virtual ~ImageView(); |
| 38 | 39 |
| 39 // Set the bitmap that should be displayed. | 40 // Set the bitmap that should be displayed. |
| 40 void SetImage(const SkBitmap& bm); | 41 void SetImage(const SkBitmap& bm); |
| 41 | 42 |
| 42 // Set the bitmap that should be displayed from a pointer. Reset the image | 43 // Set the image that should be displayed from a pointer. Reset the image |
| 43 // if the pointer is NULL. The pointer contents is copied in the receiver's | 44 // if the pointer is NULL. The pointer contents is copied in the receiver's |
| 44 // bitmap. | 45 // bitmap. |
| 45 void SetImage(const SkBitmap* bm); | 46 void SetImage(const gfx::ImageSkia* image_skia); |
| 46 | 47 |
| 47 // Returns the bitmap currently displayed or NULL of none is currently set. | 48 // Returns the bitmap currently displayed or NULL of none is currently set. |
| 48 // The returned bitmap is still owned by the ImageView. | 49 // The returned bitmap is still owned by the ImageView. |
| 49 const SkBitmap& GetImage(); | 50 const SkBitmap& GetImage(); |
| 50 | 51 |
| 51 // Set the desired image size for the receiving ImageView. | 52 // Set the desired image size for the receiving ImageView. |
| 52 void SetImageSize(const gfx::Size& image_size); | 53 void SetImageSize(const gfx::Size& image_size); |
| 53 | 54 |
| 54 // Return the preferred size for the receiving view. Returns false if the | 55 // Return the preferred size for the receiving view. Returns false if the |
| 55 // preferred size is not defined, which means that the view uses the image | 56 // preferred size is not defined, which means that the view uses the image |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 // The current tooltip text. | 105 // The current tooltip text. |
| 105 string16 tooltip_text_; | 106 string16 tooltip_text_; |
| 106 | 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(ImageView); | 108 DISALLOW_COPY_AND_ASSIGN(ImageView); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // namespace views | 111 } // namespace views |
| 111 | 112 |
| 112 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ | 113 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ |
| OLD | NEW |