| 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 "base/strings/string16.h" | 5 #include "base/strings/string16.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "content/browser/accessibility/browser_accessibility.h" | 7 #include "content/browser/accessibility/browser_accessibility.h" |
| 8 #include "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include "content/browser/accessibility/browser_accessibility_win.h" | 10 #include "content/browser/accessibility/browser_accessibility_win.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return new CountedBrowserAccessibility(); | 60 return new CountedBrowserAccessibility(); |
| 61 } | 61 } |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 class TestBrowserAccessibilityDelegate | 64 class TestBrowserAccessibilityDelegate |
| 65 : public BrowserAccessibilityDelegate { | 65 : public BrowserAccessibilityDelegate { |
| 66 public: | 66 public: |
| 67 TestBrowserAccessibilityDelegate() | 67 TestBrowserAccessibilityDelegate() |
| 68 : got_fatal_error_(false) {} | 68 : got_fatal_error_(false) {} |
| 69 | 69 |
| 70 virtual void SetAccessibilityFocus(int acc_obj_id) OVERRIDE {} | 70 virtual void AccessibilitySetFocus(int acc_obj_id) OVERRIDE {} |
| 71 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE {} | 71 virtual void AccessibilityDoDefaultAction(int acc_obj_id) OVERRIDE {} |
| 72 virtual void AccessibilityShowMenu(int acc_obj_id) OVERRIDE {} |
| 72 virtual void AccessibilityScrollToMakeVisible( | 73 virtual void AccessibilityScrollToMakeVisible( |
| 73 int acc_obj_id, gfx::Rect subfocus) OVERRIDE {} | 74 int acc_obj_id, gfx::Rect subfocus) OVERRIDE {} |
| 74 virtual void AccessibilityScrollToPoint( | 75 virtual void AccessibilityScrollToPoint( |
| 75 int acc_obj_id, gfx::Point point) OVERRIDE {} | 76 int acc_obj_id, gfx::Point point) OVERRIDE {} |
| 76 virtual void AccessibilitySetTextSelection( | 77 virtual void AccessibilitySetTextSelection( |
| 77 int acc_obj_id, int start_offset, int end_offset) OVERRIDE {} | 78 int acc_obj_id, int start_offset, int end_offset) OVERRIDE {} |
| 78 virtual bool HasFocus() const OVERRIDE { | 79 virtual bool AccessibilityViewHasFocus() const OVERRIDE { |
| 79 return false; | 80 return false; |
| 80 } | 81 } |
| 81 virtual gfx::Rect GetViewBounds() const OVERRIDE { | 82 virtual gfx::Rect AccessibilityGetViewBounds() const OVERRIDE { |
| 82 return gfx::Rect(); | 83 return gfx::Rect(); |
| 83 } | 84 } |
| 84 virtual gfx::Point GetLastTouchEventLocation() const OVERRIDE { | 85 virtual gfx::Point AccessibilityOriginInScreen( |
| 86 const gfx::Rect& bounds) const OVERRIDE { |
| 85 return gfx::Point(); | 87 return gfx::Point(); |
| 86 } | 88 } |
| 87 virtual void FatalAccessibilityTreeError() OVERRIDE { | 89 virtual void AccessibilityFatalError() OVERRIDE { |
| 88 got_fatal_error_ = true; | 90 got_fatal_error_ = true; |
| 89 } | 91 } |
| 90 | 92 |
| 91 bool got_fatal_error() const { return got_fatal_error_; } | 93 bool got_fatal_error() const { return got_fatal_error_; } |
| 92 void reset_got_fatal_error() { got_fatal_error_ = false; } | 94 void reset_got_fatal_error() { got_fatal_error_ = false; } |
| 93 | 95 |
| 94 private: | 96 private: |
| 95 bool got_fatal_error_; | 97 bool got_fatal_error_; |
| 96 }; | 98 }; |
| 97 | 99 |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 923 ASSERT_EQ(NULL, manager->NextInTreeOrder(node5_accessible)); | 925 ASSERT_EQ(NULL, manager->NextInTreeOrder(node5_accessible)); |
| 924 | 926 |
| 925 ASSERT_EQ(NULL, manager->PreviousInTreeOrder(NULL)); | 927 ASSERT_EQ(NULL, manager->PreviousInTreeOrder(NULL)); |
| 926 ASSERT_EQ(node4_accessible, manager->PreviousInTreeOrder(node5_accessible)); | 928 ASSERT_EQ(node4_accessible, manager->PreviousInTreeOrder(node5_accessible)); |
| 927 ASSERT_EQ(node3_accessible, manager->PreviousInTreeOrder(node4_accessible)); | 929 ASSERT_EQ(node3_accessible, manager->PreviousInTreeOrder(node4_accessible)); |
| 928 ASSERT_EQ(node2_accessible, manager->PreviousInTreeOrder(node3_accessible)); | 930 ASSERT_EQ(node2_accessible, manager->PreviousInTreeOrder(node3_accessible)); |
| 929 ASSERT_EQ(root_accessible, manager->PreviousInTreeOrder(node2_accessible)); | 931 ASSERT_EQ(root_accessible, manager->PreviousInTreeOrder(node2_accessible)); |
| 930 } | 932 } |
| 931 | 933 |
| 932 } // namespace content | 934 } // namespace content |
| OLD | NEW |