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

Unified Diff: trunk/src/content/browser/renderer_host/render_view_host_impl.h

Issue 408663006: Revert 284065 "Revert of Revert of Migrate accessibility from Re..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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: trunk/src/content/browser/renderer_host/render_view_host_impl.h
===================================================================
--- trunk/src/content/browser/renderer_host/render_view_host_impl.h (revision 284469)
+++ trunk/src/content/browser/renderer_host/render_view_host_impl.h (working copy)
@@ -25,10 +25,13 @@
#include "third_party/WebKit/public/web/WebConsoleMessage.h"
#include "third_party/WebKit/public/web/WebPopupType.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/accessibility/ax_node_data.h"
#include "ui/base/window_open_disposition.h"
class SkBitmap;
class FrameMsg_Navigate;
+struct AccessibilityHostMsg_EventParams;
+struct AccessibilityHostMsg_LocationChangeParams;
struct MediaPlayerAction;
struct ViewHostMsg_CreateWindow_Params;
struct ViewHostMsg_ShowPopup_Params;
@@ -405,6 +408,30 @@
// Set the opener to null in the renderer process.
void DisownOpener();
+ // Turn on accessibility testing. The given callback will be run
+ // every time an accessibility notification is received from the
+ // renderer process, and the accessibility tree it sent can be
+ // retrieved using accessibility_tree_for_testing().
+ void SetAccessibilityCallbackForTesting(
+ const base::Callback<void(ui::AXEvent, int)>& callback);
+
+ // Only valid if SetAccessibilityCallbackForTesting was called and
+ // the callback was run at least once. Returns a snapshot of the
+ // accessibility tree received from the renderer as of the last time
+ // an accessibility notification was received.
+ const ui::AXTree& ax_tree_for_testing() {
+ CHECK(ax_tree_.get());
+ return *ax_tree_.get();
+ }
+
+ // Set accessibility callbacks.
+ void SetAccessibilityLayoutCompleteCallbackForTesting(
+ const base::Closure& callback);
+ void SetAccessibilityLoadCompleteCallbackForTesting(
+ const base::Closure& callback);
+ void SetAccessibilityOtherCallbackForTesting(
+ const base::Closure& callback);
+
bool is_waiting_for_beforeunload_ack() {
return is_waiting_for_beforeunload_ack_;
}
@@ -485,6 +512,10 @@
void OnUpdateInspectorSetting(const std::string& key,
const std::string& value);
void OnClosePageACK();
+ void OnAccessibilityEvents(
+ const std::vector<AccessibilityHostMsg_EventParams>& params);
+ void OnAccessibilityLocationChanges(
+ const std::vector<AccessibilityHostMsg_LocationChangeParams>& params);
void OnDidZoomURL(double zoom_level, const GURL& url);
void OnRunFileChooser(const FileChooserParams& params);
void OnFocusedNodeTouched(bool editable);
@@ -577,6 +608,12 @@
// TODO(nasko): Move to RenderFrameHost, as this is per-frame state.
bool unload_ack_is_for_cross_site_transition_;
+ // Accessibility callback for testing.
+ base::Callback<void(ui::AXEvent, int)> accessibility_testing_callback_;
+
+ // The most recently received accessibility tree - for testing only.
+ scoped_ptr<ui::AXTree> ax_tree_;
+
// True if the render view can be shut down suddenly.
bool sudden_termination_allowed_;

Powered by Google App Engine
This is Rietveld 408576698