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

Side by Side Diff: ui/views/accessibility/ax_obj_cache.h

Issue 246433012: Extend AXTreeSourceViews to handle aura::Window and views::Widget. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
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 UI_VIEWS_ACCESSIBILITY_AX_OBJ_CACHE_H_
6 #define UI_VIEWS_ACCESSIBILITY_AX_OBJ_CACHE_H_
7
8 #include <map>
9
10 #include "base/basictypes.h"
11
12 template <typename T> struct DefaultSingletonTraits;
13
14 namespace aura {
15 class Window;
16 } // namespace aura
17
18 namespace views {
19
20 class AXNodeSourceObjWrapper;
21 class View;
22 class Widget;
23
24 class AXObjCache {
dmazzoni 2014/04/23 05:06:44 Then this could be AXAuraObjCache, which is good b
David Tseng 2014/04/23 18:20:01 There was a point where I would have liked to shar
25 public:
26 // Get the single instance of this class.
27 static AXObjCache* GetInstance();
28
29 AXNodeSourceObjWrapper* GetOrCreate(View* view);
30 AXNodeSourceObjWrapper* GetOrCreate(Widget* widget);
31 AXNodeSourceObjWrapper* GetOrCreate(aura::Window* window);
32
33 uint32 GetID(View* view);
34 uint32 GetID(Widget* widget);
35 uint32 GetID(aura::Window* window);
36
37 private:
38 friend struct DefaultSingletonTraits<AXObjCache>;
39
40 AXObjCache() : current_id_(0) {}
41 virtual ~AXObjCache() {}
42
43 AXNodeSourceObjWrapper* Get(uint32 id);
44
45 std::map<views::View*, uint32> view_to_id_map_;
46 std::map<views::Widget*, uint32> widget_to_id_map_;
47 std::map<aura::Window*, uint32> window_to_id_map_;
48
49 std::map<uint32, AXNodeSourceObjWrapper*> cache_;
50 uint32 current_id_;
51
52 DISALLOW_COPY_AND_ASSIGN(AXObjCache);
53 };
54
55 } // namespace views
56
57 #endif // UI_VIEWS_ACCESSIBILITY_AX_OBJ_CACHE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698