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

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

Issue 2271893002: Creates AXPosition to uniquely identify a position in the accessibility tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created a factory. Created 4 years, 2 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/ax_platform_position.h
diff --git a/content/browser/accessibility/ax_platform_position.h b/content/browser/accessibility/ax_platform_position.h
new file mode 100644
index 0000000000000000000000000000000000000000..d7d2665d3fb0a0927377976920cf538b24e15730
--- /dev/null
+++ b/content/browser/accessibility/ax_platform_position.h
@@ -0,0 +1,59 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_
+#define CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_
+
+#include <stdint.h>
+
+#include <memory>
+
+#include "content/browser/accessibility/ax_tree_id_registry.h"
+#include "content/browser/accessibility/browser_accessibility.h"
+#include "content/browser/accessibility/browser_accessibility_manager.h"
+#include "ui/accessibility/ax_node.h"
+#include "ui/accessibility/ax_position.h"
+
+namespace content {
+
+class AXPlatformPositionFactory;
+
+class AXPlatformPosition : ui::AXPosition {
+ public:
+ ~AXPlatformPosition() override;
+
+ protected:
+ friend class AXPlatformPositionFactory;
+ AXPlatformPosition(AXTreeIDRegistry::AXTreeID tree_id,
+ int32_t anchor_id,
+ int child_index,
+ int text_offset,
+ ui::AXPositionType type,
+ std::unique_ptr<ui::AXPositionFactory> factory =
dmazzoni 2016/10/04 20:08:24 It's not necessarily a bad idea to have an object
+ std::make_unique<AXPlatformPositionFactory>());
+
+ BrowserAccessibility* GetPlatformNodeInTree(
+ AXTreeIDRegistry::AXTreeID tree_id,
+ int32_t node_id) const;
+ ui::AXNode* GetNodeInTree(AXTreeIDRegistry::AXTreeID tree_id,
+ int32_t node_id) const override;
+ int MaxTextOffset() const override;
+};
+
+class AXPlatformPositionFactory : ui::AXPositionFactory {
+ public:
+ virtual ~AXPlatformPositionFactory() {}
+
+ ui::AXPosition CreateNullPosition() override;
+ ui::AXPosition CreateTreePosition(int tree_id,
+ int32_t anchor_id,
+ int child_index) override;
+ ui::AXPosition CreateTextPosition(int tree_id,
+ int32_t anchor_id,
+ int text_offset) override;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ACCESSIBILITY_AX_PLATFORM_POSITION_H_

Powered by Google App Engine
This is Rietveld 408576698