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

Unified Diff: views/widget/widget_win.cc

Issue 2823009: Keep a map of all views that have sent notifications. This ensures that Acce... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 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
« no previous file with comments | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget_win.cc
===================================================================
--- views/widget/widget_win.cc (revision 50246)
+++ views/widget/widget_win.cc (working copy)
@@ -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.
@@ -57,7 +57,9 @@
is_mouse_down_(false),
is_window_(false),
restore_focus_when_enabled_(false),
- delegate_(NULL) {
+ delegate_(NULL),
+ accessibility_view_events_index_(-1),
+ accessibility_view_events_(kMaxAccessibilityViewEvents) {
}
WidgetWin::~WidgetWin() {
@@ -112,6 +114,31 @@
contents_.reset(NULL);
}
+View* WidgetWin::GetAccessibilityViewEventAt(int id) {
+ // Convert from MSAA child id.
+ id = -(id + 1);
+ DCHECK(id >= 0 && id < kMaxAccessibilityViewEvents);
+ return accessibility_view_events_[id];
+}
+
+int WidgetWin::AddAccessibilityViewEvent(View* view) {
+ accessibility_view_events_index_ =
+ (accessibility_view_events_index_ + 1) % kMaxAccessibilityViewEvents;
+ accessibility_view_events_[accessibility_view_events_index_] = view;
+
+ // Convert to MSAA child id.
+ return -(accessibility_view_events_index_ + 1);
+}
+
+void WidgetWin::ClearAccessibilityViewEvent(View* view) {
+ for (std::vector<View*>::iterator it = accessibility_view_events_.begin();
+ it != accessibility_view_events_.end();
+ ++it) {
+ if (*it == view)
+ *it = NULL;
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
// Widget implementation:
@@ -428,6 +455,9 @@
View *child) {
if (drop_target_.get())
drop_target_->ResetTargetViewIfEquals(child);
+
+ if (!is_add)
+ ClearAccessibilityViewEvent(child);
}
« no previous file with comments | « views/widget/widget_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698