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

Side by Side Diff: chrome/browser/accessibility/ax_tree_id_registry.h

Issue 667713006: Implement automatic load of composed/embedded automation trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
6 #define CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
7
8 #include <map>
9
10 #include "base/stl_util.h"
11 #include "ui/accessibility/ax_export.h"
12
13 template <typename T>
14 struct DefaultSingletonTraits;
15
16 // A class which generates a unique id given a process id and routing id.
17 // Currently, placeholder implementation pending finalization of out of process
18 // iframes.
19 class AX_EXPORT AXTreeIDRegistry {
20 public:
21 typedef int AXTreeID;
22 typedef std::pair<int, int> FrameID;
23
24 // Get the single instance of this class.
25 static AXTreeIDRegistry* GetInstance();
26
27 // Obtains a unique id given a |process_id| and |routing_id|. Placeholder
28 // for full implementation once out of process iframe accessibility finalizes.
29 int GetOrCreateAXTreeID(int process_id, int routing_id);
30 FrameID GetFrameID(int ax_tree_id);
31 void RemoveAXTreeID(int ax_tree_id);
32
33 private:
34 friend struct DefaultSingletonTraits<AXTreeIDRegistry>;
35
36 AXTreeIDRegistry();
37 virtual ~AXTreeIDRegistry();
38
39 // Tracks the current unique ax frame id.
40 int ax_tree_id_counter_;
41
42 // Maps an accessibility tree to its frame via ids.
43 std::map<AXTreeID, FrameID> ax_tree_to_frame_id_map_;
44
45 // Maps frames to an accessibility tree via ids.
46 std::map<FrameID, AXTreeID> frame_to_ax_tree_id_map_;
47
48 DISALLOW_COPY_AND_ASSIGN(AXTreeIDRegistry);
49 };
50
51 #endif // CHROME_BROWSER_ACCESSIBILITY_AX_TREE_ID_REGISTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698