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

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: Add forgotten file back 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
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/WebAccessibilityObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/ChromeClientImpl.cpp
diff --git a/Source/web/ChromeClientImpl.cpp b/Source/web/ChromeClientImpl.cpp
index 36d2ce84d4954c094f7033590bc274d08487b565..999d3b396ce895bb3f439cc95e406050d2b63427 100644
--- a/Source/web/ChromeClientImpl.cpp
+++ b/Source/web/ChromeClientImpl.cpp
@@ -128,6 +128,13 @@ static WebAccessibilityNotification toWebAccessibilityNotification(AXObjectCache
return static_cast<WebAccessibilityNotification>(notification);
}
+// Converts a WebCore::AXObjectCache::AXNotification to a WebKit::WebAXEvent
+static WebAXEvent toWebAXEvent(AXObjectCache::AXNotification notification)
+{
+ // These enums have the same values; enforced in AssertMatchingEnums.cpp.
+ return static_cast<WebAXEvent>(notification);
+}
+
ChromeClientImpl::ChromeClientImpl(WebViewImpl* webView)
: m_webView(webView)
, m_toolbarsVisible(true)
@@ -801,8 +808,12 @@ void ChromeClientImpl::getPopupMenuInfo(PopupContainer* popupContainer,
void ChromeClientImpl::postAccessibilityNotification(AccessibilityObject* obj, AXObjectCache::AXNotification notification)
{
// Alert assistive technology about the accessibility object notification.
- if (obj)
- m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification));
+ if (!obj)
+ return;
+
+ // FIXME: Remove this first call once Chromium has switched over to using the second. (http://crbug.com/269034)
+ m_webView->client()->postAccessibilityNotification(WebAccessibilityObject(obj), toWebAccessibilityNotification(notification));
+ m_webView->client()->postAccessibilityEvent(WebAccessibilityObject(obj), toWebAXEvent(notification));
}
String ChromeClientImpl::acceptLanguages()
« no previous file with comments | « Source/web/AssertMatchingEnums.cpp ('k') | Source/web/WebAccessibilityObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698