| 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_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_win.h" |
| 6 | 6 |
| 7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
| 8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 return E_FAIL; | 484 return E_FAIL; |
| 485 | 485 |
| 486 return GetPlatformNodeWin()->accLocation(x_left, y_top, width, height, | 486 return GetPlatformNodeWin()->accLocation(x_left, y_top, width, height, |
| 487 var_id); | 487 var_id); |
| 488 } | 488 } |
| 489 | 489 |
| 490 STDMETHODIMP BrowserAccessibilityWin::accNavigate(LONG nav_dir, | 490 STDMETHODIMP BrowserAccessibilityWin::accNavigate(LONG nav_dir, |
| 491 VARIANT start, | 491 VARIANT start, |
| 492 VARIANT* end) { | 492 VARIANT* end) { |
| 493 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_NAVIGATE); | 493 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_NAVIGATE); |
| 494 |
| 495 // Forward all directions but NAVDIR_ to the platform node implementation. |
| 496 if (nav_dir != NAVDIR_DOWN && nav_dir != NAVDIR_UP && |
| 497 nav_dir != NAVDIR_LEFT && nav_dir != NAVDIR_RIGHT) { |
| 498 return GetPlatformNodeWin()->accNavigate(nav_dir, start, end); |
| 499 } |
| 500 |
| 494 BrowserAccessibilityWin* target = GetTargetFromChildID(start); | 501 BrowserAccessibilityWin* target = GetTargetFromChildID(start); |
| 495 if (!target) | 502 if (!target) |
| 496 return E_INVALIDARG; | 503 return E_INVALIDARG; |
| 497 | 504 |
| 498 // Forward all directions but NAVDIR_ to the platform node implementation. | |
| 499 if (nav_dir != NAVDIR_DOWN && nav_dir != NAVDIR_UP && | |
| 500 nav_dir != NAVDIR_LEFT && nav_dir != NAVDIR_RIGHT) { | |
| 501 return target->GetPlatformNodeWin()->accNavigate(nav_dir, start, end); | |
| 502 } | |
| 503 | |
| 504 BrowserAccessibility* result = nullptr; | 505 BrowserAccessibility* result = nullptr; |
| 505 switch (nav_dir) { | 506 switch (nav_dir) { |
| 506 case NAVDIR_DOWN: | 507 case NAVDIR_DOWN: |
| 507 result = target->GetTableCell(GetTableRow() + GetTableRowSpan(), | 508 result = target->GetTableCell(GetTableRow() + GetTableRowSpan(), |
| 508 GetTableColumn()); | 509 GetTableColumn()); |
| 509 break; | 510 break; |
| 510 case NAVDIR_UP: | 511 case NAVDIR_UP: |
| 511 result = target->GetTableCell(GetTableRow() - 1, GetTableColumn()); | 512 result = target->GetTableCell(GetTableRow() - 1, GetTableColumn()); |
| 512 break; | 513 break; |
| 513 case NAVDIR_LEFT: | 514 case NAVDIR_LEFT: |
| (...skipping 5158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5672 return static_cast<BrowserAccessibilityWin*>(obj); | 5673 return static_cast<BrowserAccessibilityWin*>(obj); |
| 5673 } | 5674 } |
| 5674 | 5675 |
| 5675 const BrowserAccessibilityWin* | 5676 const BrowserAccessibilityWin* |
| 5676 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { | 5677 ToBrowserAccessibilityWin(const BrowserAccessibility* obj) { |
| 5677 DCHECK(!obj || obj->IsNative()); | 5678 DCHECK(!obj || obj->IsNative()); |
| 5678 return static_cast<const BrowserAccessibilityWin*>(obj); | 5679 return static_cast<const BrowserAccessibilityWin*>(obj); |
| 5679 } | 5680 } |
| 5680 | 5681 |
| 5681 } // namespace content | 5682 } // namespace content |
| OLD | NEW |