Chromium Code Reviews| Index: views/widget/native_widget_win.h |
| =================================================================== |
| --- views/widget/native_widget_win.h (revision 107097) |
| +++ views/widget/native_widget_win.h (working copy) |
| @@ -14,6 +14,7 @@ |
| #include <string> |
| #include <vector> |
| +#include "base/hash_tables.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/scoped_vector.h" |
| @@ -102,22 +103,12 @@ |
| can_update_layered_window_ = can_update_layered_window; |
| } |
| - // Obtain the view event with the given MSAA child id. Used in |
| + // Obtain the view corresponding to a MSAA child id. Used in |
| // NativeViewAccessibilityWin::get_accChild to support requests for |
| // children of windowless controls. May return NULL |
| // (see ViewHierarchyChanged). |
| - View* GetAccessibilityViewEventAt(int id); |
| + View* GetAccessibilityViewFromChildId(long id); |
|
sky
2011/10/25 20:08:45
How about naming this GetViewByAccessibleId().
I d
dmazzoni
2011/10/26 16:46:13
Sure - since the view hierarchy is pretty small, I
|
| - // Add a view that has recently fired an accessibility event. Returns a MSAA |
| - // child id which is generated by: -(index of view in vector + 1) which |
| - // guarantees a negative child id. This distinguishes the view from |
| - // positive MSAA child id's which are direct leaf children of views that have |
| - // associated hWnd's (e.g. NativeWidgetWin). |
| - int AddAccessibilityViewEvent(View* view); |
| - |
| - // Clear a view that has recently been removed on a hierarchy change. |
| - void ClearAccessibilityViewEvent(View* view); |
| - |
| // Hides the window if it hasn't already been force-hidden. The force hidden |
| // count is tracked, so calling multiple times is allowed, you just have to |
| // be sure to call PopForceHidden the same number of times. |
| @@ -595,17 +586,9 @@ |
| // Value determines whether the Widget is customized for accessibility. |
| static bool screen_reader_active_; |
| - // The maximum number of view events in our vector below. |
| - static const int kMaxAccessibilityViewEvents = 20; |
| + // A map from a unique ID to a descendant view, for accessibility. |
| + base::hash_map<long, View*> accessibility_id_view_map_; |
| - // A vector used to access views for which we have sent notifications to |
| - // accessibility clients. It is used as a circular queue. |
| - std::vector<View*> accessibility_view_events_; |
| - |
| - // The current position of the view events vector. When incrementing, |
| - // we always mod this value with the max view events above . |
| - int accessibility_view_events_index_; |
| - |
| // The last cursor that was active before the current one was selected. Saved |
| // so that we can restore it. |
| gfx::NativeCursor previous_cursor_; |