OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/browser_accessibility_manager_win.h" | 5 #include "chrome/browser/browser_accessibility_manager_win.h" |
6 | 6 |
7 #include "chrome/browser/browser_accessibility_win.h" | 7 #include "chrome/browser/browser_accessibility_win.h" |
8 #include "chrome/browser/renderer_host/render_process_host.h" | 8 #include "chrome/browser/renderer_host/render_process_host.h" |
9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 BrowserAccessibility* BrowserAccessibilityManager::UpdateTree( | 152 BrowserAccessibility* BrowserAccessibilityManager::UpdateTree( |
153 const webkit_glue::WebAccessibility& acc_obj) { | 153 const webkit_glue::WebAccessibility& acc_obj) { |
154 base::hash_map<int, LONG>::iterator iter = | 154 base::hash_map<int, LONG>::iterator iter = |
155 renderer_id_to_child_id_map_.find(acc_obj.id); | 155 renderer_id_to_child_id_map_.find(acc_obj.id); |
156 if (iter == renderer_id_to_child_id_map_.end()) | 156 if (iter == renderer_id_to_child_id_map_.end()) |
157 return NULL; | 157 return NULL; |
158 | 158 |
159 LONG child_id = iter->second; | 159 LONG child_id = iter->second; |
160 BrowserAccessibility* old_browser_acc = GetFromChildID(child_id); | 160 BrowserAccessibility* old_browser_acc = GetFromChildID(child_id); |
| 161 if (!old_browser_acc) |
| 162 return NULL; |
161 | 163 |
162 if (old_browser_acc->GetChildCount() == 0 && acc_obj.children.size() == 0) { | 164 if (old_browser_acc->GetChildCount() == 0 && acc_obj.children.size() == 0) { |
163 // Reinitialize the BrowserAccessibility if there are no children to update. | 165 // Reinitialize the BrowserAccessibility if there are no children to update. |
164 old_browser_acc->Initialize( | 166 old_browser_acc->Initialize( |
165 this, | 167 this, |
166 old_browser_acc->GetParent(), | 168 old_browser_acc->GetParent(), |
167 child_id, | 169 child_id, |
168 old_browser_acc->index_in_parent(), | 170 old_browser_acc->index_in_parent(), |
169 acc_obj); | 171 acc_obj); |
170 | 172 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1) | 219 if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1) |
218 focus_ = instance; | 220 focus_ = instance; |
219 for (int i = 0; i < static_cast<int>(src.children.size()); ++i) { | 221 for (int i = 0; i < static_cast<int>(src.children.size()); ++i) { |
220 BrowserAccessibility* child = CreateAccessibilityTree( | 222 BrowserAccessibility* child = CreateAccessibilityTree( |
221 instance, GetNextChildID(), src.children[i], i); | 223 instance, GetNextChildID(), src.children[i], i); |
222 instance->AddChild(child); | 224 instance->AddChild(child); |
223 } | 225 } |
224 | 226 |
225 return instance; | 227 return instance; |
226 } | 228 } |
OLD | NEW |