[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 5 | #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
6 | #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 7 | |
[email protected] | 20bb006 | 2010-10-06 21:24:37 | [diff] [blame] | 8 | #include <oleacc.h> |
9 | |||||
[email protected] | 8ee65ba | 2011-04-12 20:53:23 | [diff] [blame] | 10 | #include "base/win/scoped_comptr.h" |
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 11 | #include "content/browser/accessibility/browser_accessibility_manager.h" |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 12 | |
[email protected] | e6b3487 | 2012-10-24 20:51:32 | [diff] [blame] | 13 | namespace content { |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 14 | class BrowserAccessibilityWin; |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 15 | |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 16 | // Manages a tree of BrowserAccessibilityWin objects. |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 17 | class CONTENT_EXPORT BrowserAccessibilityManagerWin |
18 | : public BrowserAccessibilityManager { | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 19 | public: |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 20 | BrowserAccessibilityManagerWin( |
21 | HWND parent_hwnd, | ||||
22 | IAccessible* parent_iaccessible, | ||||
23 | const AccessibilityNodeData& src, | ||||
24 | BrowserAccessibilityDelegate* delegate, | ||||
25 | BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); | ||||
26 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 27 | virtual ~BrowserAccessibilityManagerWin(); |
28 | |||||
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 29 | static AccessibilityNodeData GetEmptyDocument(); |
30 | |||||
31 | // Get the closest containing HWND. | ||||
[email protected] | afe8375 | 2013-03-20 01:58:41 | [diff] [blame^] | 32 | HWND parent_hwnd() { return parent_hwnd_; } |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 33 | |
[email protected] | afe8375 | 2013-03-20 01:58:41 | [diff] [blame^] | 34 | // The IAccessible for the parent window. |
35 | IAccessible* parent_iaccessible() { return parent_iaccessible_; } | ||||
36 | void set_parent_iaccessible(IAccessible* parent_iaccessible) { | ||||
37 | parent_iaccessible_ = parent_iaccessible; | ||||
38 | } | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 39 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 40 | // BrowserAccessibilityManager methods |
[email protected] | a527a02 | 2011-02-10 02:32:36 | [diff] [blame] | 41 | virtual void NotifyAccessibilityEvent(int type, BrowserAccessibility* node); |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 42 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame] | 43 | // Track this object and post a VISIBLE_DATA_CHANGED notification when |
44 | // its container scrolls. | ||||
45 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
46 | void TrackScrollingObject(BrowserAccessibilityWin* node); | ||||
47 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 48 | private: |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 49 | // The closest ancestor HWND. |
50 | HWND parent_hwnd_; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 51 | |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame] | 52 | // The accessibility instance for the parent window. |
53 | IAccessible* parent_iaccessible_; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 54 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 55 | // Give BrowserAccessibilityManager::Create access to our constructor. |
56 | friend class BrowserAccessibilityManager; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 57 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame] | 58 | // Track the most recent object that has been asked to scroll and |
59 | // post a notification directly on it when it reaches its destination. | ||||
60 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
61 | BrowserAccessibilityWin* tracked_scroll_object_; | ||||
62 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 63 | DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); |
64 | }; | ||||
65 | |||||
[email protected] | e6b3487 | 2012-10-24 20:51:32 | [diff] [blame] | 66 | } // namespace content |
67 | |||||
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 68 | #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |