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

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

Issue 125763003: Refactor content/renderer/accessibility to use AXTreeSerializer (re-land). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Little fixes Created 6 years, 10 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
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.h" 5 #include "content/browser/accessibility/browser_accessibility_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/accessibility/browser_accessibility.h" 8 #include "content/browser/accessibility/browser_accessibility.h"
9 #include "content/common/accessibility_messages.h" 9 #include "content/common/accessibility_messages.h"
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 renderer_id_map_.erase(renderer_id); 124 renderer_id_map_.erase(renderer_id);
125 } 125 }
126 126
127 void BrowserAccessibilityManager::OnAccessibilityEvents( 127 void BrowserAccessibilityManager::OnAccessibilityEvents(
128 const std::vector<AccessibilityHostMsg_EventParams>& params) { 128 const std::vector<AccessibilityHostMsg_EventParams>& params) {
129 bool should_send_initial_focus = false; 129 bool should_send_initial_focus = false;
130 130
131 // Process all changes to the accessibility tree first. 131 // Process all changes to the accessibility tree first.
132 for (uint32 index = 0; index < params.size(); index++) { 132 for (uint32 index = 0; index < params.size(); index++) {
133 const AccessibilityHostMsg_EventParams& param = params[index]; 133 const AccessibilityHostMsg_EventParams& param = params[index];
134 if (!UpdateNodes(param.nodes)) 134 if (!UpdateNodes(param.update.nodes))
135 return; 135 return;
136 136
137 // Set initial focus when a page is loaded. 137 // Set initial focus when a page is loaded.
138 ui::AXEvent event_type = param.event_type; 138 ui::AXEvent event_type = param.event_type;
139 if (event_type == ui::AX_EVENT_LOAD_COMPLETE) { 139 if (event_type == ui::AX_EVENT_LOAD_COMPLETE) {
140 if (!focus_) { 140 if (!focus_) {
141 SetFocus(root_, false); 141 SetFocus(root_, false);
142 should_send_initial_focus = true; 142 should_send_initial_focus = true;
143 } 143 }
144 } 144 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // Keep track of what node is focused. 424 // Keep track of what node is focused.
425 if (src.role != ui::AX_ROLE_ROOT_WEB_AREA && 425 if (src.role != ui::AX_ROLE_ROOT_WEB_AREA &&
426 src.role != ui::AX_ROLE_WEB_AREA && 426 src.role != ui::AX_ROLE_WEB_AREA &&
427 (src.state >> ui::AX_STATE_FOCUSED & 1)) { 427 (src.state >> ui::AX_STATE_FOCUSED & 1)) {
428 SetFocus(instance, false); 428 SetFocus(instance, false);
429 } 429 }
430 return success; 430 return success;
431 } 431 }
432 432
433 } // namespace content 433 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698