diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/accessibility/accessibility_types.h | 1 | ||||
-rw-r--r-- | views/accessibility/view_accessibility.cc | 2 | ||||
-rw-r--r-- | views/window/non_client_view.cc | 21 | ||||
-rw-r--r-- | views/window/non_client_view.h | 6 |
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); }; |