#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"
namespace content {
class BrowserAccessibility;
+class BrowserAccessibilityManager;
#if defined(OS_ANDROID)
class BrowserAccessibilityManagerAndroid;
#endif
const ui::AXNodeData& node9 = ui::AXNodeData());
// Class that can perform actions on behalf of the BrowserAccessibilityManager.
+// Note: BrowserAccessibilityManager should never cache any of the return
+// values from any of these interfaces, especially those that return pointers.
+// They may only be valid within this call stack. That policy eliminates any
+// concerns about ownership and lifecycle issues; none of these interfaces
+// transfer ownership and no return values are guaranteed to be valid outside
+// of the current call stack.
class CONTENT_EXPORT BrowserAccessibilityDelegate {
public:
virtual ~BrowserAccessibilityDelegate() {}
virtual void AccessibilityFatalError() = 0;
virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget() = 0;
virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible() = 0;
+ virtual BrowserAccessibilityManager* AccessibilityGetChildFrame(
+ int accessibility_node_id) = 0;
+ virtual BrowserAccessibility* AccessibilityGetParentFrame() = 0;
};
class CONTENT_EXPORT BrowserAccessibilityFactory {
delegate_ = delegate;
}
+ // Get a snapshot of the current tree as an AXTreeUpdate.
+ ui::AXTreeUpdate SnapshotAXTreeForTesting();
+
protected:
BrowserAccessibilityManager(
BrowserAccessibilityDelegate* delegate,
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_;
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_;