OLD | NEW |
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return; | 168 return; |
169 } | 169 } |
170 | 170 |
171 // Set focus to the root if it's not anywhere else. | 171 // Set focus to the root if it's not anywhere else. |
172 if (!focus_) { | 172 if (!focus_) { |
173 SetFocus(tree_->GetRoot(), false); | 173 SetFocus(tree_->GetRoot(), false); |
174 should_send_initial_focus = true; | 174 should_send_initial_focus = true; |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
| 178 OnTreeUpdateFinished(); |
| 179 |
178 if (should_send_initial_focus && | 180 if (should_send_initial_focus && |
179 (!delegate_ || delegate_->AccessibilityViewHasFocus())) { | 181 (!delegate_ || delegate_->AccessibilityViewHasFocus())) { |
180 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetFromAXNode(focus_)); | 182 NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetFromAXNode(focus_)); |
181 } | 183 } |
182 | 184 |
183 // Now iterate over the events again and fire the events. | 185 // Now iterate over the events again and fire the events. |
184 for (uint32 index = 0; index < params.size(); index++) { | 186 for (uint32 index = 0; index < params.size(); index++) { |
185 const AccessibilityHostMsg_EventParams& param = params[index]; | 187 const AccessibilityHostMsg_EventParams& param = params[index]; |
186 | 188 |
187 // Find the node corresponding to the id that's the target of the | 189 // Find the node corresponding to the id that's the target of the |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 | 357 |
356 void BrowserAccessibilityManager::OnNodeCreationFinished(ui::AXNode* node) { | 358 void BrowserAccessibilityManager::OnNodeCreationFinished(ui::AXNode* node) { |
357 GetFromAXNode(node)->OnUpdateFinished(); | 359 GetFromAXNode(node)->OnUpdateFinished(); |
358 } | 360 } |
359 | 361 |
360 void BrowserAccessibilityManager::OnNodeChangeFinished(ui::AXNode* node) { | 362 void BrowserAccessibilityManager::OnNodeChangeFinished(ui::AXNode* node) { |
361 GetFromAXNode(node)->OnUpdateFinished(); | 363 GetFromAXNode(node)->OnUpdateFinished(); |
362 } | 364 } |
363 | 365 |
364 } // namespace content | 366 } // namespace content |
OLD | NEW |