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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 15741009: Native Android accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 7 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: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index aedf26abebef2fb24b48b26e1ccf7d865190373a..524d1485e7eb0229f2198f93b380fcbc2166116b 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -17,6 +17,7 @@
#include "cc/layers/texture_layer.h"
#include "cc/output/compositor_frame.h"
#include "cc/output/compositor_frame_ack.h"
+#include "content/browser/accessibility/browser_accessibility_manager_android.h"
#include "content/browser/android/content_view_core_impl.h"
#include "content/browser/android/overscroll_glow.h"
#include "content/browser/gpu/gpu_surface_tracker.h"
@@ -816,6 +817,65 @@ InputEventAckState RenderWidgetHostViewAndroid::FilterInputEvent(
void RenderWidgetHostViewAndroid::OnAccessibilityNotifications(
David Trainor- moved to gerrit 2013/06/04 20:27:18 What causes this event to be thrown? Ideally we'l
dmazzoni 2013/06/07 20:23:16 That's correct - they won't even be sent until the
const std::vector<AccessibilityHostMsg_NotificationParams>& params) {
+ if (!GetBrowserAccessibilityManager()) {
+ SetBrowserAccessibilityManager(
+ new BrowserAccessibilityManagerAndroid(
+ content_view_core_,
+ BrowserAccessibilityManagerAndroid::GetEmptyDocument(),
+ this));
+ }
+ GetBrowserAccessibilityManager()->OnAccessibilityNotifications(params);
+}
+
+void RenderWidgetHostViewAndroid::SetAccessibilityFocus(int acc_obj_id) {
+ if (!host_)
+ return;
+
+ LOG(INFO) << "SetAccessibilityFocus";
David Trainor- moved to gerrit 2013/06/04 20:27:18 Remove
dmazzoni 2013/06/07 20:23:16 Done.
+ host_->AccessibilitySetFocus(acc_obj_id);
+}
+
+void RenderWidgetHostViewAndroid::AccessibilityDoDefaultAction(int acc_obj_id) {
+ if (!host_)
+ return;
+
+ host_->AccessibilityDoDefaultAction(acc_obj_id);
+}
+
+void RenderWidgetHostViewAndroid::AccessibilityScrollToMakeVisible(
+ int acc_obj_id, gfx::Rect subfocus) {
+ if (!host_)
+ return;
+
+ host_->AccessibilityScrollToMakeVisible(acc_obj_id, subfocus);
+}
+
+void RenderWidgetHostViewAndroid::AccessibilityScrollToPoint(
+ int acc_obj_id, gfx::Point point) {
+ if (!host_)
+ return;
+
+ host_->AccessibilityScrollToPoint(acc_obj_id, point);
+}
+
+void RenderWidgetHostViewAndroid::AccessibilitySetTextSelection(
+ int acc_obj_id, int start_offset, int end_offset) {
+ if (!host_)
+ return;
+
+ host_->AccessibilitySetTextSelection(
+ acc_obj_id, start_offset, end_offset);
+}
+
+gfx::Point RenderWidgetHostViewAndroid::GetLastTouchEventLocation() const {
+ NOTIMPLEMENTED();
+ // Only used on Win8
+ return gfx::Point();
+}
+
+void RenderWidgetHostViewAndroid::FatalAccessibilityTreeError() {
+ host_->FatalAccessibilityTreeError();
+ SetBrowserAccessibilityManager(NULL);
}
bool RenderWidgetHostViewAndroid::LockMouse() {

Powered by Google App Engine
This is Rietveld 408576698