Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: Source/web/ChromeClientImpl.cpp

Issue 22331005: Clean up accessibility enums for use in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update failing tests, add one missing role Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index a567df5fb456590ea758bd5021d11a271bdce7d8..b17390bd98deddd8a4e01d5d57532d152fd42c67 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -129,6 +129,13 @@ static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache
return static_cast<WebAccessibilityNotification>(notification);
}
+// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAXEvent
+static WebAXTypes::Event toWebAXEvent(AXObjectCache::AXNotification notification)
+{
+ // These enums have the same values; enforced in AssertMatchingEnums.cpp.
+ return static_cast<WebAXTypes::Event>(notification);
+}
+
ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
: m_webView(webView)
, m_toolbarsVisible(true)
@@ -805,8 +812,12 @@ void ChromeClientImpl::getPopupMenuInfo(PopupContainer* popupContainer,
void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification)
{
// Alert assistive technology about the accessibility object notification.
- if (obj)
+ if (obj) {
jamesr 2013/08/21 02:22:52 early return on !obj is more readable and requires
dmazzoni 2013/08/22 20:58:23 Done.
+ // TODO(dmazzoni): remove this first call once Chromium has
jamesr 2013/08/21 02:22:52 Blink style is FIXME:, not TODO(name). You have a
dmazzoni 2013/08/22 20:58:23 TODO changed to FIXME throughout.
+ // switched over. (http://crbug.com/269034)
m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification));
+ m_webView->client()->postAccessibilityEvent(WebAccessibilityObject(obj), toWebAXEvent(notification));
+ }
}
String ChromeClientImpl::acceptLanguages()

Powered by Google App Engine
This is Rietveld 408576698