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

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

Issue 407493002: Revert of Migrate accessibility from RenderView to RenderFrame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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: content/browser/renderer_host/render_view_host_impl.h
diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
index e2a97648b6317adaadf1d23a78f26b0530f14a46..204d31ce3d840f09dc28297a9770340208af87f1 100644
--- a/content/browser/renderer_host/render_view_host_impl.h
+++ b/content/browser/renderer_host/render_view_host_impl.h
@@ -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_;
« no previous file with comments | « content/browser/renderer_host/render_view_host_delegate.h ('k') | content/browser/renderer_host/render_view_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698