summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 21:34:20 +0000
committerklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-28 21:34:20 +0000
commit92a22704ea2f408ffc7917c1e96ca1f097a6ecb7 (patch)
treed4d1e69dd1c0a2fecada7ae6dee924b9d30dace3 /views
parent3eb73b83046e13cd7ed56fa863684d36fd7098b4 (diff)
downloadchromium_src-92a22704ea2f408ffc7917c1e96ca1f097a6ecb7.zip
chromium_src-92a22704ea2f408ffc7917c1e96ca1f097a6ecb7.tar.gz
chromium_src-92a22704ea2f408ffc7917c1e96ca1f097a6ecb7.tar.bz2
Adds additional MSAA information to fill in a few gaps in the hierarchy.
TEST=None BUG=None Review URL: http://codereview.chromium.org/160239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/accessibility/accessibility_types.h1
-rw-r--r--views/accessibility/view_accessibility.cc2
-rw-r--r--views/window/non_client_view.cc21
-rw-r--r--views/window/non_client_view.h6
4 files changed, 30 insertions, 0 deletions
diff --git a/views/accessibility/accessibility_types.h b/views/accessibility/accessibility_types.h
index ee4d864..18365b2 100644
--- a/views/accessibility/accessibility_types.h
+++ b/views/accessibility/accessibility_types.h
@@ -30,6 +30,7 @@ class AccessibilityTypes {
ROLE_PUSHBUTTON,
ROLE_SEPARATOR,
ROLE_TEXT,
+ ROLE_TITLEBAR,
ROLE_TOOLBAR,
ROLE_WINDOW
};
diff --git a/views/accessibility/view_accessibility.cc b/views/accessibility/view_accessibility.cc
index f9ee1bd..72bd9f5 100644
--- a/views/accessibility/view_accessibility.cc
+++ b/views/accessibility/view_accessibility.cc
@@ -632,6 +632,8 @@ long ViewAccessibility::MSAARole(AccessibilityTypes::Role role) {
return ROLE_SYSTEM_SEPARATOR;
case AccessibilityTypes::ROLE_TEXT:
return ROLE_SYSTEM_TEXT;
+ case AccessibilityTypes::ROLE_TITLEBAR:
+ return ROLE_SYSTEM_TITLEBAR;
case AccessibilityTypes::ROLE_TOOLBAR:
return ROLE_SYSTEM_TOOLBAR;
case AccessibilityTypes::ROLE_WINDOW:
diff --git a/views/window/non_client_view.cc b/views/window/non_client_view.cc
index c089f76..2060eb6 100644
--- a/views/window/non_client_view.cc
+++ b/views/window/non_client_view.cc
@@ -184,6 +184,27 @@ views::View* NonClientView::GetViewForPoint(const gfx::Point& point) {
return View::GetViewForPoint(point);
}
+bool NonClientView::GetAccessibleRole(AccessibilityTypes::Role* role) {
+ DCHECK(role);
+
+ *role = AccessibilityTypes::ROLE_WINDOW;
+ return true;
+}
+
+bool NonClientView::GetAccessibleName(std::wstring* name) {
+ DCHECK(name);
+
+ if (!accessible_name_.empty()) {
+ *name = accessible_name_;
+ return true;
+ }
+ return false;
+}
+
+void NonClientView::SetAccessibleName(const std::wstring& name) {
+ accessible_name_ = name;
+}
+
////////////////////////////////////////////////////////////////////////////////
// NonClientFrameView, View overrides:
diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h
index 6ac38ac..797ff77 100644
--- a/views/window/non_client_view.h
+++ b/views/window/non_client_view.h
@@ -194,6 +194,9 @@ class NonClientView : public View {
virtual gfx::Size GetPreferredSize();
virtual gfx::Size GetMinimumSize();
virtual void Layout();
+ virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
+ virtual bool GetAccessibleName(std::wstring* name);
+ virtual void SetAccessibleName(const std::wstring& name);
protected:
// NonClientView, View overrides:
@@ -214,6 +217,9 @@ class NonClientView : public View {
// dynamically as the system settings change.
scoped_ptr<NonClientFrameView> frame_view_;
+ // The accessible name of this view.
+ std::wstring accessible_name_;
+
DISALLOW_COPY_AND_ASSIGN(NonClientView);
};