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

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager_win.cc

Issue 214243005: Fire accessibility focus/blur events on root web document. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/accessibility/browser_accessibility_manager_win.h" 5 #include "content/browser/accessibility/browser_accessibility_manager_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/win/scoped_comptr.h" 8 #include "base/win/scoped_comptr.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 10 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 void BrowserAccessibilityManagerWin::RemoveNode(BrowserAccessibility* node) { 90 void BrowserAccessibilityManagerWin::RemoveNode(BrowserAccessibility* node) {
91 unique_id_to_renderer_id_map_.erase( 91 unique_id_to_renderer_id_map_.erase(
92 node->ToBrowserAccessibilityWin()->unique_id_win()); 92 node->ToBrowserAccessibilityWin()->unique_id_win());
93 BrowserAccessibilityManager::RemoveNode(node); 93 BrowserAccessibilityManager::RemoveNode(node);
94 if (node == tracked_scroll_object_) { 94 if (node == tracked_scroll_object_) {
95 tracked_scroll_object_->Release(); 95 tracked_scroll_object_->Release();
96 tracked_scroll_object_ = NULL; 96 tracked_scroll_object_ = NULL;
97 } 97 }
98 } 98 }
99 99
100 void BrowserAccessibilityManagerWin::OnWindowFocused() {
101 if (focus_ != root_)
102 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, root_);
103 BrowserAccessibilityManager::OnWindowFocused();
David Tseng 2014/04/02 22:05:05 Does ordering matter here? If I were a client, I m
dmazzoni 2014/04/02 22:09:55 Yes, that's the order you'll get: first root, then
104 }
105
106 void BrowserAccessibilityManagerWin::OnWindowBlurred() {
107 if (focus_ != root_)
David Tseng 2014/04/02 22:19:51 Sorry; this was the one I meant to comment on; see
108 NotifyAccessibilityEvent(ui::AX_EVENT_BLUR, root_);
109 BrowserAccessibilityManager::OnWindowBlurred();
110 }
111
100 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( 112 void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
101 ui::AXEvent event_type, 113 ui::AXEvent event_type,
102 BrowserAccessibility* node) { 114 BrowserAccessibility* node) {
103 if (node->role() == ui::AX_ROLE_INLINE_TEXT_BOX) 115 if (node->role() == ui::AX_ROLE_INLINE_TEXT_BOX)
104 return; 116 return;
105 117
106 LONG event_id = EVENT_MIN; 118 LONG event_id = EVENT_MIN;
107 switch (event_type) { 119 switch (event_type) {
108 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: 120 case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED:
109 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; 121 event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // |parent_iaccessible_| are no longer valid either, since they were 245 // |parent_iaccessible_| are no longer valid either, since they were
234 // derived from AccessibleHWND. We don't have to restore them to 246 // derived from AccessibleHWND. We don't have to restore them to
235 // previous values, though, because this should only happen 247 // previous values, though, because this should only happen
236 // during the destruct sequence for this window. 248 // during the destruct sequence for this window.
237 accessible_hwnd_ = NULL; 249 accessible_hwnd_ = NULL;
238 parent_hwnd_ = NULL; 250 parent_hwnd_ = NULL;
239 parent_iaccessible_ = NULL; 251 parent_iaccessible_ = NULL;
240 } 252 }
241 253
242 } // namespace content 254 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698