diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-07 10:28:48 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-07-09 15:09:44 +0200 |
commit | a9853701193c81c65f80a606943864cd9b1f4431 (patch) | |
tree | 401b380f8636830f8dedbcf40f23a156285fa156 /src/core/web_contents_adapter.cpp | |
parent | bef6cc644f176a69a85c68126bd0d7e50ab5757e (diff) |
Add core accessibility
This commit adds the basics to bridge the blink
accessibility classes to QAccessibleInterfaces.
Note that it needs two follow up commits to implement the bridging from
the QWidget/Qt Quick worlds.
[ChangeLog][Accessibility] QtWebEngine now has accessibility
support, enabling assistive technology such as screen readers to work
with it.
Change-Id: Ied1d97e61a024115ac7a9245331211f6d9fac1b4
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 8b0aafe21..235534f18 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -74,6 +74,7 @@ #include <QStringList> #include <QStyleHints> #include <QVariant> +#include <QtGui/qaccessible.h> static const int kTestWindowWidth = 800; static const int kTestWindowHeight = 600; @@ -609,6 +610,13 @@ void WebContentsAdapter::enableInspector(bool enable) ContentBrowserClientQt::Get()->enableInspector(enable); } +QAccessibleInterface *WebContentsAdapter::browserAccessible() +{ + Q_D(const WebContentsAdapter); + RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(d->webContents->GetRenderWidgetHostView()); + return rwhv ? rwhv->GetQtAccessible() : Q_NULLPTR; +} + void WebContentsAdapter::runJavaScript(const QString &javaScript) { Q_D(WebContentsAdapter); |