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/accessibility/browser_accessibility_manager.h" | 5 #include "chrome/browser/accessibility/browser_accessibility_manager.h" |
6 | 6 |
7 #include "chrome/browser/accessibility/browser_accessibility.h" | 7 #include "chrome/browser/accessibility/browser_accessibility.h" |
8 | 8 |
9 using webkit_glue::WebAccessibility; | 9 using webkit_glue::WebAccessibility; |
10 | 10 |
(...skipping 208 matching lines...) Loading... |
219 if (delegate_) | 219 if (delegate_) |
220 delegate_->SetAccessibilityFocus(node.renderer_id()); | 220 delegate_->SetAccessibilityFocus(node.renderer_id()); |
221 } | 221 } |
222 | 222 |
223 void BrowserAccessibilityManager::DoDefaultAction( | 223 void BrowserAccessibilityManager::DoDefaultAction( |
224 const BrowserAccessibility& node) { | 224 const BrowserAccessibility& node) { |
225 if (delegate_) | 225 if (delegate_) |
226 delegate_->AccessibilityDoDefaultAction(node.renderer_id()); | 226 delegate_->AccessibilityDoDefaultAction(node.renderer_id()); |
227 } | 227 } |
228 | 228 |
| 229 gfx::Rect BrowserAccessibilityManager::GetViewBounds(){ |
| 230 if (delegate_) |
| 231 return delegate_->GetViewBounds(); |
| 232 return gfx::Rect(); |
| 233 } |
| 234 |
229 bool BrowserAccessibilityManager::CanModifyTreeInPlace( | 235 bool BrowserAccessibilityManager::CanModifyTreeInPlace( |
230 BrowserAccessibility* current_root, | 236 BrowserAccessibility* current_root, |
231 const WebAccessibility& new_root) { | 237 const WebAccessibility& new_root) { |
232 if (current_root->renderer_id() != new_root.id) | 238 if (current_root->renderer_id() != new_root.id) |
233 return false; | 239 return false; |
234 if (current_root->GetChildCount() != new_root.children.size()) | 240 if (current_root->GetChildCount() != new_root.children.size()) |
235 return false; | 241 return false; |
236 for (unsigned int i = 0; i < current_root->GetChildCount(); i++) { | 242 for (unsigned int i = 0; i < current_root->GetChildCount(); i++) { |
237 if (!CanModifyTreeInPlace(current_root->GetChild(i), | 243 if (!CanModifyTreeInPlace(current_root->GetChild(i), |
238 new_root.children[i])) { | 244 new_root.children[i])) { |
(...skipping 70 matching lines...) Loading... |
309 if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1) | 315 if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1) |
310 focus_ = instance; | 316 focus_ = instance; |
311 for (int i = 0; i < static_cast<int>(src.children.size()); ++i) { | 317 for (int i = 0; i < static_cast<int>(src.children.size()); ++i) { |
312 BrowserAccessibility* child = CreateAccessibilityTree( | 318 BrowserAccessibility* child = CreateAccessibilityTree( |
313 instance, GetNextChildID(), src.children[i], i); | 319 instance, GetNextChildID(), src.children[i], i); |
314 instance->AddChild(child); | 320 instance->AddChild(child); |
315 } | 321 } |
316 | 322 |
317 return instance; | 323 return instance; |
318 } | 324 } |
OLD | NEW |