summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authorctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 00:24:20 +0000
committerctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-16 00:24:20 +0000
commit00854125164910b0bced16bcb67fdf583b9d28c0 (patch)
tree65e4d7738977aa66ae5ef1122b74ca1f6e56aa3f /views/controls
parentf5205419c04244f460891b8ff8e30d3793ffa507 (diff)
downloadchromium_src-00854125164910b0bced16bcb67fdf583b9d28c0.zip
chromium_src-00854125164910b0bced16bcb67fdf583b9d28c0.tar.gz
chromium_src-00854125164910b0bced16bcb67fdf583b9d28c0.tar.bz2
Provide Web Contents accessibility info.
BUG=36286 TEST=Verify accessibility info in AccExplorer32.exe. Review URL: http://codereview.chromium.org/652199 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/single_split_view.cc17
-rw-r--r--views/controls/single_split_view.h9
2 files changed, 25 insertions, 1 deletions
diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc
index d3031ce..10dc967 100644
--- a/views/controls/single_split_view.cc
+++ b/views/controls/single_split_view.cc
@@ -94,6 +94,23 @@ void SingleSplitView::Layout() {
View::Layout();
}
+bool SingleSplitView::GetAccessibleRole(AccessibilityTypes::Role* role) {
+ *role = AccessibilityTypes::ROLE_GROUPING;
+ return true;
+}
+
+bool SingleSplitView::GetAccessibleName(std::wstring* name) {
+ if (!accessible_name_.empty()) {
+ *name = accessible_name_;
+ return true;
+ }
+ return false;
+}
+
+void SingleSplitView::SetAccessibleName(const std::wstring& name) {
+ accessible_name_ = name;
+}
+
gfx::Size SingleSplitView::GetPreferredSize() {
int width = 0;
int height = 0;
diff --git a/views/controls/single_split_view.h b/views/controls/single_split_view.h
index 3ed92ac..6dc3f91 100644
--- a/views/controls/single_split_view.h
+++ b/views/controls/single_split_view.h
@@ -25,6 +25,10 @@ class SingleSplitView : public views::View {
virtual void Layout();
+ virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
+ virtual bool GetAccessibleName(std::wstring* name);
+ virtual void SetAccessibleName(const std::wstring& name);
+
// SingleSplitView's preferred size is the sum of the preferred widths
// and the max of the heights.
virtual gfx::Size GetPreferredSize();
@@ -52,7 +56,7 @@ class SingleSplitView : public views::View {
private:
// Returns true if |x| or |y| is over the divider.
- bool IsPointInDivider(const gfx::Point& p);
+ bool IsPointInDivider(const gfx::Point& p);
// Returns width in case of horizontal split and height otherwise.
int GetPrimaryAxisSize() {
@@ -81,6 +85,9 @@ class SingleSplitView : public views::View {
bool resize_leading_on_bounds_change_;
+ // The accessible name of this view.
+ std::wstring accessible_name_;
+
DISALLOW_COPY_AND_ASSIGN(SingleSplitView);
};