summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/tab_contents
diff options
context:
space:
mode:
authorklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 23:43:25 +0000
committerklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-23 23:43:25 +0000
commit759dd968342752e9b30710197898f777f1add3d8 (patch)
treefcbb6cba7299141e06c333228ea07670018d4212 /chrome/browser/views/tab_contents
parentf028f136dbb4b497355e1f03d925d9991ad00a19 (diff)
downloadchromium_src-759dd968342752e9b30710197898f777f1add3d8.zip
chromium_src-759dd968342752e9b30710197898f777f1add3d8.tar.gz
chromium_src-759dd968342752e9b30710197898f777f1add3d8.tar.bz2
Adds MSAA information to various (previously uncovered) bits of the UI, including Bookmark and Extensions infobars. This is to moving towards completing the hierarchy for the benefit of full screen reader support.
BUG=None. Test=None. Review URL: http://codereview.chromium.org/155446 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/tab_contents')
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_container.cc21
-rw-r--r--chrome/browser/views/tab_contents/tab_contents_container.h6
2 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/views/tab_contents/tab_contents_container.cc b/chrome/browser/views/tab_contents/tab_contents_container.cc
index 5e1d2b0..f865e5e 100644
--- a/chrome/browser/views/tab_contents/tab_contents_container.cc
+++ b/chrome/browser/views/tab_contents/tab_contents_container.cc
@@ -75,6 +75,27 @@ void TabContentsContainer::Layout() {
}
}
+bool TabContentsContainer::GetAccessibleRole(AccessibilityTypes::Role* role) {
+ DCHECK(role);
+
+ *role = AccessibilityTypes::ROLE_WINDOW;
+ return true;
+}
+
+bool TabContentsContainer::GetAccessibleName(std::wstring* name) {
+ DCHECK(name);
+
+ if (!accessible_name_.empty()) {
+ name->assign(accessible_name_);
+ return true;
+ }
+ return false;
+}
+
+void TabContentsContainer::SetAccessibleName(const std::wstring& name) {
+ accessible_name_.assign(name);
+}
+
void TabContentsContainer::ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child) {
diff --git a/chrome/browser/views/tab_contents/tab_contents_container.h b/chrome/browser/views/tab_contents/tab_contents_container.h
index d7a8afe..3f60eec 100644
--- a/chrome/browser/views/tab_contents/tab_contents_container.h
+++ b/chrome/browser/views/tab_contents/tab_contents_container.h
@@ -41,6 +41,9 @@ class TabContentsContainer : public views::View,
// Overridden from views::View:
virtual void Layout();
+ virtual bool GetAccessibleName(std::wstring* name);
+ virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
+ virtual void SetAccessibleName(const std::wstring& name);
protected:
// Overridden from views::View:
@@ -72,6 +75,9 @@ class TabContentsContainer : public views::View,
// Handles registering for our notifications.
NotificationRegistrar registrar_;
+ // Storage of the string needed for accessibility.
+ std::wstring accessible_name_;
+
DISALLOW_COPY_AND_ASSIGN(TabContentsContainer);
};