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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.h

Issue 268543008: Cross-process iframe accessibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rewritten based on RFHI instead of RVHI Created 6 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: content/browser/accessibility/browser_accessibility_manager.h
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h
index c3f0430935fc958d8f524da16efe5bc90d517c07..bfbc68adca8194bed97dc90bac727a03e978e346 100644
--- a/content/browser/accessibility/browser_accessibility_manager.h
+++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -13,7 +13,7 @@
#include "content/common/content_export.h"
#include "third_party/WebKit/public/web/WebAXEnums.h"
#include "ui/accessibility/ax_node_data.h"
-#include "ui/accessibility/ax_tree.h"
+#include "ui/accessibility/ax_serializable_tree.h"
#include "ui/accessibility/ax_tree_update.h"
#include "ui/gfx/native_widget_types.h"
@@ -22,6 +22,7 @@ struct AccessibilityHostMsg_LocationChangeParams;
namespace content {
class BrowserAccessibility;
+class BrowserAccessibilityManager;
#if defined(OS_ANDROID)
class BrowserAccessibilityManagerAndroid;
#endif
@@ -29,6 +30,8 @@ class BrowserAccessibilityManagerAndroid;
class BrowserAccessibilityManagerWin;
#endif
+const int kNoFrameId = -1;
Charlie Reis 2014/08/21 19:23:27 This is a bit ambiguous for a content-wide constan
dmazzoni 2014/08/25 06:49:36 WIth the other changes, this is only needed in bro
+
// For testing.
CONTENT_EXPORT ui::AXTreeUpdate MakeAXTreeUpdate(
const ui::AXNodeData& node,
@@ -63,6 +66,9 @@ class CONTENT_EXPORT BrowserAccessibilityDelegate {
virtual void AccessibilityFatalError() = 0;
virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() = 0;
virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() = 0;
+ virtual BrowserAccessibilityManager* AccessibilityGetChildFrame(
+ int64 frame_id) = 0;
+ virtual BrowserAccessibilityManager* AccessibilityGetParentFrame() = 0;
};
class CONTENT_EXPORT BrowserAccessibilityFactory {
@@ -189,6 +195,14 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
delegate_ = delegate;
}
+ // Get a snapshot of the current tree as an AXTreeUpdate.
+ ui::AXTreeUpdate SnapshotAXTreeForTesting();
+
+ // Frame tree support.
+ void SetNodeIdInParentFrame(int32 node_id);
+ void SetChildFrameId(int32 node_id, int64 child_frame_id);
+ BrowserAccessibility* GetCrossFrameParent();
+
protected:
BrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate,
@@ -225,21 +239,6 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
OSK_ALLOWED
};
- // Update a set of nodes using data received from the renderer
- // process.
- bool UpdateNodes(const std::vector<ui::AXNodeData>& nodes);
-
- // Update one node from the tree using data received from the renderer
- // process. Returns true on success, false on fatal error.
- bool UpdateNode(const ui::AXNodeData& src);
-
- void SetRoot(BrowserAccessibility* root);
-
- BrowserAccessibility* CreateNode(
- BrowserAccessibility* parent,
- int32 id,
- int32 index_in_parent);
-
protected:
// The object that can perform actions on our behalf.
BrowserAccessibilityDelegate* delegate_;
@@ -248,7 +247,7 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
scoped_ptr<BrowserAccessibilityFactory> factory_;
// The underlying tree of accessibility objects.
- scoped_ptr<ui::AXTree> tree_;
+ scoped_ptr<ui::AXSerializableTree> tree_;
// The node that currently has focus.
ui::AXNode* focus_;
@@ -256,6 +255,11 @@ class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate {
// A mapping from a node id to its wrapper of type BrowserAccessibility.
base::hash_map<int32, BrowserAccessibility*> id_wrapper_map_;
+ // This is set if this tree's frame is the child of another frame.
+ // It's the id of the node in the parent frame that's the parent of this
+ // frame's root object.
Charlie Reis 2014/08/20 20:37:13 This comment is kind of hard to follow. Maybe it
dmazzoni 2014/08/20 20:57:17 Sure. I'll work on the comment, but for purposes
dmazzoni 2014/08/25 06:49:36 This is gone now.
+ uint32 node_id_in_parent_frame_;
+
// The on-screen keyboard state.
OnScreenKeyboardState osk_state_;

Powered by Google App Engine
This is Rietveld 408576698