diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-27 23:00:03 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-27 23:00:03 +0000 |
commit | b82a049e6ffc65c14daf1c2c8bee6390cb7fe1fa (patch) | |
tree | 21f95e3df23460ae77342f865a24178d0cadba89 /chrome/browser/views | |
parent | 6f496b2703a7ccb7bba1dbb14a2b9c00f02a853e (diff) | |
download | chromium_src-b82a049e6ffc65c14daf1c2c8bee6390cb7fe1fa.zip chromium_src-b82a049e6ffc65c14daf1c2c8bee6390cb7fe1fa.tar.gz chromium_src-b82a049e6ffc65c14daf1c2c8bee6390cb7fe1fa.tar.bz2 |
Initial work to fix the IAccessible tree in circumstances where there is a widget not at the root of the UI heirarchy. Also contains misc fixes for setting correct name/role for controls found in the Options dialog.
BUG=9621
TEST=none
Review URL: http://codereview.chromium.org/2174002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48444 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
5 files changed, 32 insertions, 6 deletions
diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc index 3426d22..39cb18e2 100644 --- a/chrome/browser/views/options/options_group_view.cc +++ b/chrome/browser/views/options/options_group_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,6 +48,10 @@ OptionsGroupView::OptionsGroupView(views::View* contents, description_label_->SetMultiLine(true); description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + + SetAccessibleName(title); + contents->SetAccessibleName(title); + contents->SetAccessibleRole(AccessibilityTypes::ROLE_GROUPING); } void OptionsGroupView::SetHighlighted(bool highlighted) { @@ -62,6 +66,11 @@ int OptionsGroupView::GetContentsWidth() const { /////////////////////////////////////////////////////////////////////////////// // OptionsGroupView, views::View overrides: +bool OptionsGroupView::GetAccessibleRole(AccessibilityTypes::Role* role) { + *role = AccessibilityTypes::ROLE_GROUPING; + return true; +} + void OptionsGroupView::Paint(gfx::Canvas* canvas) { if (highlighted_) { COLORREF infocolor = GetSysColor(COLOR_INFOBK); diff --git a/chrome/browser/views/options/options_group_view.h b/chrome/browser/views/options/options_group_view.h index de39226..83a638f 100644 --- a/chrome/browser/views/options/options_group_view.h +++ b/chrome/browser/views/options/options_group_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -34,6 +34,7 @@ class OptionsGroupView : public views::View { protected: // views::View overrides: + virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); virtual void Paint(gfx::Canvas* canvas); virtual void ViewHierarchyChanged(bool is_add, views::View* parent, @@ -55,7 +56,7 @@ class OptionsGroupView : public views::View { // user's attention. bool highlighted_; - DISALLOW_EVIL_CONSTRUCTORS(OptionsGroupView); + DISALLOW_COPY_AND_ASSIGN(OptionsGroupView); }; #endif // CHROME_BROWSER_VIEWS_OPTIONS_OPTIONS_GROUP_VIEW_H__ diff --git a/chrome/browser/views/options/options_page_view.cc b/chrome/browser/views/options/options_page_view.cc index c0d5efb..933ee9a 100644 --- a/chrome/browser/views/options/options_page_view.cc +++ b/chrome/browser/views/options/options_page_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -35,3 +35,9 @@ void OptionsPageView::ViewHierarchyChanged(bool is_add, NotifyPrefChanged(NULL); } } + +bool OptionsPageView::GetAccessibleRole(AccessibilityTypes::Role* role) { + *role = AccessibilityTypes::ROLE_PAGETAB; + return true; +} + diff --git a/chrome/browser/views/options/options_page_view.h b/chrome/browser/views/options/options_page_view.h index 3c29acf..289b00a 100644 --- a/chrome/browser/views/options/options_page_view.h +++ b/chrome/browser/views/options/options_page_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -40,11 +40,13 @@ class OptionsPageView : public views::View, views::View* parent, views::View* child); + virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); + private: // Whether or not the control layout has been initialized for this page. bool initialized_; - DISALLOW_EVIL_CONSTRUCTORS(OptionsPageView); + DISALLOW_COPY_AND_ASSIGN(OptionsPageView); }; #endif // CHROME_BROWSER_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index 86933b65..a01cebe 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -53,6 +53,7 @@ class OptionsWindowView : public views::View, virtual void TabSelectedAt(int index); // views::View overrides: + virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); virtual void Layout(); virtual gfx::Size GetPreferredSize(); @@ -170,6 +171,11 @@ void OptionsWindowView::TabSelectedAt(int index) { /////////////////////////////////////////////////////////////////////////////// // OptionsWindowView, views::View overrides: +bool OptionsWindowView::GetAccessibleRole(AccessibilityTypes::Role* role) { + *role = AccessibilityTypes::ROLE_CLIENT; + return true; +} + void OptionsWindowView::Layout() { tabs_->SetBounds(kDialogPadding, kDialogPadding, width() - (2 * kDialogPadding), @@ -196,6 +202,8 @@ void OptionsWindowView::ViewHierarchyChanged(bool is_add, void OptionsWindowView::Init() { tabs_ = new views::TabbedPane; + tabs_->SetAccessibleName(l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE, + l10n_util::GetString(IDS_PRODUCT_NAME))); tabs_->SetListener(this); AddChildView(tabs_); |