| 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_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 if (node->manager() != last_focused_manager_ && | 226 if (node->manager() != last_focused_manager_ && |
| 227 node != node->manager()->GetRoot()) { | 227 node != node->manager()->GetRoot()) { |
| 228 BrowserAccessibilityEvent::Create(source, | 228 BrowserAccessibilityEvent::Create(source, |
| 229 ui::AX_EVENT_FOCUS, | 229 ui::AX_EVENT_FOCUS, |
| 230 node->manager()->GetRoot())->Fire(); | 230 node->manager()->GetRoot())->Fire(); |
| 231 } | 231 } |
| 232 | 232 |
| 233 BrowserAccessibilityManager::FireFocusEvent(source, node); | 233 BrowserAccessibilityManager::FireFocusEvent(source, node); |
| 234 } | 234 } |
| 235 | 235 |
| 236 gfx::Rect BrowserAccessibilityManagerWin::GetViewBounds() { |
| 237 // We have to take the device scale factor into account on Windows. |
| 238 BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager(); |
| 239 if (delegate) { |
| 240 gfx::Rect bounds = delegate->AccessibilityGetViewBounds(); |
| 241 if (device_scale_factor() > 0.0 && device_scale_factor() != 1.0) |
| 242 bounds = ScaleToEnclosingRect(bounds, device_scale_factor()); |
| 243 return bounds; |
| 244 } |
| 245 return gfx::Rect(); |
| 246 } |
| 247 |
| 236 void BrowserAccessibilityManagerWin::OnNodeCreated(ui::AXTree* tree, | 248 void BrowserAccessibilityManagerWin::OnNodeCreated(ui::AXTree* tree, |
| 237 ui::AXNode* node) { | 249 ui::AXNode* node) { |
| 238 DCHECK(node); | 250 DCHECK(node); |
| 239 BrowserAccessibilityManager::OnNodeCreated(tree, node); | 251 BrowserAccessibilityManager::OnNodeCreated(tree, node); |
| 240 BrowserAccessibility* obj = GetFromAXNode(node); | 252 BrowserAccessibility* obj = GetFromAXNode(node); |
| 241 if (!obj) | 253 if (!obj) |
| 242 return; | 254 return; |
| 243 if (!obj->IsNative()) | 255 if (!obj->IsNative()) |
| 244 return; | 256 return; |
| 245 } | 257 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 DCHECK(changed_node); | 299 DCHECK(changed_node); |
| 288 BrowserAccessibility* obj = GetFromAXNode(changed_node); | 300 BrowserAccessibility* obj = GetFromAXNode(changed_node); |
| 289 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { | 301 if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { |
| 290 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents( | 302 ToBrowserAccessibilityWin(obj)->UpdateStep3FireEvents( |
| 291 changes[i].type == AXTreeDelegate::SUBTREE_CREATED); | 303 changes[i].type == AXTreeDelegate::SUBTREE_CREATED); |
| 292 } | 304 } |
| 293 } | 305 } |
| 294 } | 306 } |
| 295 | 307 |
| 296 } // namespace content | 308 } // namespace content |
| OLD | NEW |