OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 VIEWS_CONTROLS_IMAGE_VIEW_H_ | 5 #ifndef VIEWS_CONTROLS_IMAGE_VIEW_H_ |
6 #define VIEWS_CONTROLS_IMAGE_VIEW_H_ | 6 #define VIEWS_CONTROLS_IMAGE_VIEW_H_ |
7 | 7 |
8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
9 #include "views/view.h" | 9 #include "views/view.h" |
10 | 10 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 Alignment GetVerticalAlignment(); | 67 Alignment GetVerticalAlignment(); |
68 | 68 |
69 // Set / Get the tooltip text. | 69 // Set / Get the tooltip text. |
70 void SetTooltipText(const std::wstring& tooltip); | 70 void SetTooltipText(const std::wstring& tooltip); |
71 std::wstring GetTooltipText(); | 71 std::wstring GetTooltipText(); |
72 | 72 |
73 // Return whether the image should be centered inside the view. | 73 // Return whether the image should be centered inside the view. |
74 // Overriden from View | 74 // Overriden from View |
75 virtual gfx::Size GetPreferredSize(); | 75 virtual gfx::Size GetPreferredSize(); |
76 virtual void Paint(gfx::Canvas* canvas); | 76 virtual void Paint(gfx::Canvas* canvas); |
77 virtual bool GetAccessibleName(std::wstring* name); | |
78 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); | 77 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
79 | 78 |
80 // Overriden from View. | 79 // Overriden from View. |
81 virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); | 80 virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); |
82 | 81 |
83 private: | 82 private: |
84 // Compute the image origin given the desired size and the receiver alignment | 83 // Compute the image origin given the desired size and the receiver alignment |
85 // properties. | 84 // properties. |
86 void ComputeImageOrigin(int image_width, int image_height, int *x, int *y); | 85 void ComputeImageOrigin(int image_width, int image_height, int *x, int *y); |
87 | 86 |
(...skipping 14 matching lines...) Expand all Loading... |
102 | 101 |
103 // The current tooltip text. | 102 // The current tooltip text. |
104 std::wstring tooltip_text_; | 103 std::wstring tooltip_text_; |
105 | 104 |
106 DISALLOW_COPY_AND_ASSIGN(ImageView); | 105 DISALLOW_COPY_AND_ASSIGN(ImageView); |
107 }; | 106 }; |
108 | 107 |
109 } // namespace views | 108 } // namespace views |
110 | 109 |
111 #endif // VIEWS_CONTROLS_IMAGE_VIEW_H_ | 110 #endif // VIEWS_CONTROLS_IMAGE_VIEW_H_ |
OLD | NEW |