diff options
author | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 14:49:40 +0000 |
---|---|---|
committer | dmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-06 14:49:40 +0000 |
commit | 7010297385ce13f0590725f60e144f49bda1d903 (patch) | |
tree | d5319973b8e0807ab12246bbf92858e58aebaf40 /chrome/browser/tab_contents | |
parent | 5e2bc490e98ab521459bd47de6c51b7209e3d9d9 (diff) | |
download | chromium_src-7010297385ce13f0590725f60e144f49bda1d903.zip chromium_src-7010297385ce13f0590725f60e144f49bda1d903.tar.gz chromium_src-7010297385ce13f0590725f60e144f49bda1d903.tar.bz2 |
Reimplement accessibility of web content by caching the entire
accessibility tree in the browser process.
Adds new RPCs for a browser tab to request accessibility info from
a renderer; the renderer responds with a complete tree of
accessibility metadata for the entire DOM, which is then cached
in the RenderWidgetHostView. This part is cross-platform and will
help with accessibility on both Windows and Mac OS X.
For Windows, MSAA support for web content has been rewritten to
use this new cache. Tested in JAWS and NVDA screen readers.
Using Chrome with a screen reader is now fast and stable,
unlike the previous implementation. However, note that most
advanced functionality is still not supported, and much work remains
to make Chrome work well with a screen reader. This is a necessary
step to improve stability first.
BUG=25564
BUG=13291
TEST=See http://codereview.chromium.org/1806001
Review URL: http://codereview.chromium.org/1637018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46567 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 13 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 9 |
2 files changed, 21 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 9d2fd42..c4cab4e 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -290,7 +290,8 @@ TabContents::TabContents(Profile* profile, is_showing_before_unload_dialog_(false), renderer_preferences_(), opener_dom_ui_type_(DOMUIFactory::kNoDOMUI), - language_state_(&controller_) { + language_state_(&controller_), + requested_accessibility_tree_(false) { ClearBlockedContentSettings(); renderer_preferences_util::UpdateFromSystemSettings( &renderer_preferences_, profile); @@ -348,6 +349,10 @@ TabContents::TabContents(Profile* profile, // Set-up the showing of the omnibox search infobar if applicable. if (OmniboxSearchHint::IsEnabled(profile)) omnibox_search_hint_.reset(new OmniboxSearchHint(this)); + + renderer_accessible_ = + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableRendererAccessibility); } TabContents::~TabContents() { @@ -2123,6 +2128,10 @@ void TabContents::DidFailProvisionalLoadWithError( void TabContents::DocumentLoadedInFrame() { controller_.DocumentLoadedInFrame(); + if (renderer_accessible_ && !requested_accessibility_tree_) { + render_view_host()->RequestAccessibilityTree(); + requested_accessibility_tree_ = true; + } } void TabContents::OnContentBlocked(ContentSettingsType type) { @@ -2292,6 +2301,8 @@ void TabContents::DidNavigate(RenderViewHost* rvh, const ViewHostMsg_FrameNavigate_Params& params) { int extra_invalidate_flags = 0; + requested_accessibility_tree_ = false; + if (PageTransition::IsMainFrame(params.transition)) { bool was_bookmark_bar_visible = ShouldShowBookmarkBar(); bool was_extension_shelf_visible = IsExtensionShelfAlwaysVisible(); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 490aea2..9f870f5 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -1265,6 +1265,15 @@ class TabContents : public PageNavigator, // Maps each frame on this page to its geolocation content settings. GeolocationContentSettings geolocation_content_settings_; + // Whether the renderer is made accessible. + // TODO(dmazzoni): http://crbug.com/25564 This is a temporary work-around + // until that bug is fixed. + bool renderer_accessible_; + + // Keep track of if we've already requested the accessibility tree so + // we don't do it more than once. + bool requested_accessibility_tree_; + // --------------------------------------------------------------------------- DISALLOW_COPY_AND_ASSIGN(TabContents); |