diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 23:53:41 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 23:53:41 +0000 |
commit | 9870326b1412b1f3804eed8d9b6402ac60ddf8f0 (patch) | |
tree | 46225afad011decdd6b138dba35836636dee33db /views/widget/widget_win.h | |
parent | 23b060ece7a2db1ef5b4802d4903f93edb538ae3 (diff) | |
download | chromium_src-9870326b1412b1f3804eed8d9b6402ac60ddf8f0.zip chromium_src-9870326b1412b1f3804eed8d9b6402ac60ddf8f0.tar.gz chromium_src-9870326b1412b1f3804eed8d9b6402ac60ddf8f0.tar.bz2 |
Keep a cache of all views that have sent notifications. This ensures that AccessibleObjectFromEvent works properly.
BUG=9601
TEST=none
Review URL: http://codereview.chromium.org/2823009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/widget_win.h')
-rw-r--r-- | views/widget/widget_win.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index 699d60e3..98da389 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -10,6 +10,8 @@ #include <atlcrack.h> #include <atlmisc.h> +#include <vector> + #include "app/win/window_impl.h" #include "base/message_loop.h" #include "base/scoped_comptr_win.h" @@ -92,6 +94,21 @@ class WidgetWin : public app::WindowImpl, can_update_layered_window_ = can_update_layered_window; } + // Obtain the view event with the given MSAA child id. Used in + // ViewAccessibility::get_accChild to support requests for children of + // windowless controls. May return NULL (see ViewHierarchyChanged). + View* GetAccessibilityViewEventAt(int id); + + // 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. WidgetWin). + int AddAccessibilityViewEvent(View* view); + + // Clear a view that has recently been removed on a hierarchy change. + void ClearAccessibilityViewEvent(View* view); + BEGIN_MSG_MAP_EX(WidgetWin) // Range handlers must go first! MESSAGE_RANGE_HANDLER_EX(WM_MOUSEFIRST, WM_MOUSELAST, OnMouseRange) @@ -549,6 +566,17 @@ class WidgetWin : public app::WindowImpl, // Non owned pointer to optional delegate. May be NULL if no delegate is // being used. WidgetDelegate* delegate_; + + // The maximum number of view events in our vector below. + static const int kMaxAccessibilityViewEvents = 20; + + // 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_; }; } // namespace views |