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 "ui/gfx/image/image_skia.h" | 8 #include "ui/gfx/image/image_skia.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void SetFocusPainter(scoped_ptr<Painter> focus_painter); | 80 void SetFocusPainter(scoped_ptr<Painter> focus_painter); |
81 | 81 |
82 // Overriden from View: | 82 // Overriden from View: |
83 virtual gfx::Size GetPreferredSize() OVERRIDE; | 83 virtual gfx::Size GetPreferredSize() OVERRIDE; |
84 virtual void OnFocus() OVERRIDE; | 84 virtual void OnFocus() OVERRIDE; |
85 virtual void OnBlur() OVERRIDE; | 85 virtual void OnBlur() OVERRIDE; |
86 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 86 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
87 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 87 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
88 virtual bool GetTooltipText(const gfx::Point& p, | 88 virtual bool GetTooltipText(const gfx::Point& p, |
89 base::string16* tooltip) const OVERRIDE; | 89 base::string16* tooltip) const OVERRIDE; |
90 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 90 |
| 91 // ui::EventTarget: |
| 92 virtual bool CanAcceptEvent(const ui::Event& event) OVERRIDE; |
91 | 93 |
92 private: | 94 private: |
93 void OnPaintImage(gfx::Canvas* canvas); | 95 void OnPaintImage(gfx::Canvas* canvas); |
94 | 96 |
95 // Returns true if |img| is the same as the last image we painted. This is | 97 // Returns true if |img| is the same as the last image we painted. This is |
96 // intended to be a quick check, not exhaustive. In other words it's possible | 98 // intended to be a quick check, not exhaustive. In other words it's possible |
97 // for this to return false even though the images are in fact equal. | 99 // for this to return false even though the images are in fact equal. |
98 bool IsImageEqual(const gfx::ImageSkia& img) const; | 100 bool IsImageEqual(const gfx::ImageSkia& img) const; |
99 | 101 |
100 // Compute the image origin given the desired size and the receiver alignment | 102 // Compute the image origin given the desired size and the receiver alignment |
(...skipping 29 matching lines...) Expand all Loading... |
130 void* last_painted_bitmap_pixels_; | 132 void* last_painted_bitmap_pixels_; |
131 | 133 |
132 scoped_ptr<views::Painter> focus_painter_; | 134 scoped_ptr<views::Painter> focus_painter_; |
133 | 135 |
134 DISALLOW_COPY_AND_ASSIGN(ImageView); | 136 DISALLOW_COPY_AND_ASSIGN(ImageView); |
135 }; | 137 }; |
136 | 138 |
137 } // namespace views | 139 } // namespace views |
138 | 140 |
139 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ | 141 #endif // UI_VIEWS_CONTROLS_IMAGE_VIEW_H_ |
OLD | NEW |