summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/image_view.cc18
-rw-r--r--views/controls/image_view.h2
2 files changed, 19 insertions, 1 deletions
diff --git a/views/controls/image_view.cc b/views/controls/image_view.cc
index e2cf501..eb918bd 100644
--- a/views/controls/image_view.cc
+++ b/views/controls/image_view.cc
@@ -136,6 +136,22 @@ void ImageView::Paint(gfx::Canvas* canvas) {
}
}
+bool ImageView::GetAccessibleName(std::wstring* name) {
+ if (!name || tooltip_text_.empty())
+ return false;
+
+ *name = tooltip_text_;
+ return true;
+}
+
+bool ImageView::GetAccessibleRole(AccessibilityTypes::Role* role) {
+ if (!role)
+ return false;
+
+ *role = AccessibilityTypes::ROLE_GRAPHIC;
+ return true;
+}
+
void ImageView::SetHorizontalAlignment(Alignment ha) {
if (ha != horiz_alignment_) {
horiz_alignment_ = ha;
@@ -170,7 +186,7 @@ bool ImageView::GetTooltipText(int x, int y, std::wstring* tooltip) {
if (tooltip_text_.empty()) {
return false;
} else {
- * tooltip = GetTooltipText();
+ *tooltip = GetTooltipText();
return true;
}
}
diff --git a/views/controls/image_view.h b/views/controls/image_view.h
index 0ad8947..17a672e 100644
--- a/views/controls/image_view.h
+++ b/views/controls/image_view.h
@@ -74,6 +74,8 @@ class ImageView : public View {
// Overriden from View
virtual gfx::Size GetPreferredSize();
virtual void Paint(gfx::Canvas* canvas);
+ virtual bool GetAccessibleName(std::wstring* name);
+ virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
// Overriden from View.
virtual bool GetTooltipText(int x, int y, std::wstring* tooltip);