| 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| 7 | 7 |
| 8 #include <oleacc.h> | 8 #include <oleacc.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
| 14 #include "content/browser/accessibility/browser_accessibility_manager.h" | 14 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 15 #include "ui/accessibility/platform/ax_platform_node_win.h" | 15 #include "ui/accessibility/platform/ax_platform_node_win.h" |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class BrowserAccessibilityEventWin; |
| 18 class BrowserAccessibilityWin; | 19 class BrowserAccessibilityWin; |
| 19 | 20 |
| 20 // Manages a tree of BrowserAccessibilityWin objects. | 21 // Manages a tree of BrowserAccessibilityWin objects. |
| 21 class CONTENT_EXPORT BrowserAccessibilityManagerWin | 22 class CONTENT_EXPORT BrowserAccessibilityManagerWin |
| 22 : public BrowserAccessibilityManager, | 23 : public BrowserAccessibilityManager, |
| 23 public ui::IAccessible2UsageObserver { | 24 public ui::IAccessible2UsageObserver { |
| 24 public: | 25 public: |
| 25 BrowserAccessibilityManagerWin( | 26 BrowserAccessibilityManagerWin( |
| 26 const ui::AXTreeUpdate& initial_tree, | 27 const ui::AXTreeUpdate& initial_tree, |
| 27 BrowserAccessibilityDelegate* delegate, | 28 BrowserAccessibilityDelegate* delegate, |
| 28 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); | 29 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); |
| 29 | 30 |
| 30 ~BrowserAccessibilityManagerWin() override; | 31 ~BrowserAccessibilityManagerWin() override; |
| 31 | 32 |
| 32 static ui::AXTreeUpdate GetEmptyDocument(); | 33 static ui::AXTreeUpdate GetEmptyDocument(); |
| 33 | 34 |
| 34 // Get the closest containing HWND. | 35 // Get the closest containing HWND. |
| 35 HWND GetParentHWND(); | 36 HWND GetParentHWND(); |
| 36 | 37 |
| 37 // The IAccessible for the parent window. | 38 // The IAccessible for the parent window. |
| 38 IAccessible* GetParentIAccessible(); | 39 IAccessible* GetParentIAccessible(); |
| 39 | 40 |
| 40 // Calls NotifyWinEvent if the parent window's IAccessible pointer is known. | |
| 41 void MaybeCallNotifyWinEvent(DWORD event, BrowserAccessibility* node); | |
| 42 | |
| 43 // IAccessible2UsageObserver | 41 // IAccessible2UsageObserver |
| 44 void OnIAccessible2Used() override; | 42 void OnIAccessible2Used() override; |
| 45 | 43 |
| 46 // BrowserAccessibilityManager methods | 44 // BrowserAccessibilityManager methods |
| 47 void UserIsReloading() override; | 45 void UserIsReloading() override; |
| 48 void NotifyAccessibilityEvent( | 46 void NotifyAccessibilityEvent( |
| 49 ui::AXEvent event_type, BrowserAccessibility* node) override; | 47 BrowserAccessibilityEvent::Source source, |
| 48 ui::AXEvent event_type, |
| 49 BrowserAccessibility* node) override; |
| 50 BrowserAccessibilityEvent::Result |
| 51 FireWinAccessibilityEvent(BrowserAccessibilityEventWin* event); |
| 50 bool CanFireEvents() override; | 52 bool CanFireEvents() override; |
| 51 void FireFocusEvent(BrowserAccessibility* node) override; | 53 void FireFocusEvent( |
| 54 BrowserAccessibilityEvent::Source source, |
| 55 BrowserAccessibility* node) override; |
| 52 | 56 |
| 53 // Track this object and post a VISIBLE_DATA_CHANGED notification when | 57 // Track this object and post a VISIBLE_DATA_CHANGED notification when |
| 54 // its container scrolls. | 58 // its container scrolls. |
| 55 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | 59 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. |
| 56 void TrackScrollingObject(BrowserAccessibilityWin* node); | 60 void TrackScrollingObject(BrowserAccessibilityWin* node); |
| 57 | 61 |
| 58 // Called when |accessible_hwnd_| is deleted by its parent. | 62 // Called when |accessible_hwnd_| is deleted by its parent. |
| 59 void OnAccessibleHwndDeleted(); | 63 void OnAccessibleHwndDeleted(); |
| 60 | 64 |
| 61 protected: | 65 protected: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 75 // post a notification directly on it when it reaches its destination. | 79 // post a notification directly on it when it reaches its destination. |
| 76 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | 80 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. |
| 77 BrowserAccessibilityWin* tracked_scroll_object_; | 81 BrowserAccessibilityWin* tracked_scroll_object_; |
| 78 | 82 |
| 79 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); | 83 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); |
| 80 }; | 84 }; |
| 81 | 85 |
| 82 } // namespace content | 86 } // namespace content |
| 83 | 87 |
| 84 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 88 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| OLD | NEW |