[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. | ||||
32 | HWND parent_hwnd(); | ||||
33 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 34 | // Get a the default IAccessible for the parent window, does not make a |
35 | // new reference. | ||||
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame^] | 36 | IAccessible* parent_iaccessible(); |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 37 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 38 | // BrowserAccessibilityManager methods |
[email protected] | a527a02 | 2011-02-10 02:32:36 | [diff] [blame] | 39 | virtual void NotifyAccessibilityEvent(int type, BrowserAccessibility* node); |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 40 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame] | 41 | // Track this object and post a VISIBLE_DATA_CHANGED notification when |
42 | // its container scrolls. | ||||
43 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
44 | void TrackScrollingObject(BrowserAccessibilityWin* node); | ||||
45 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 46 | private: |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame^] | 47 | // The closest ancestor HWND. |
48 | HWND parent_hwnd_; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 49 | |
[email protected] | a6120e3 | 2013-03-15 11:07:35 | [diff] [blame^] | 50 | // The accessibility instance for the parent window. |
51 | IAccessible* parent_iaccessible_; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 52 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 53 | // Give BrowserAccessibilityManager::Create access to our constructor. |
54 | friend class BrowserAccessibilityManager; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 55 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame] | 56 | // Track the most recent object that has been asked to scroll and |
57 | // post a notification directly on it when it reaches its destination. | ||||
58 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
59 | BrowserAccessibilityWin* tracked_scroll_object_; | ||||
60 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 61 | DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); |
62 | }; | ||||
63 | |||||
[email protected] | e6b3487 | 2012-10-24 20:51:32 | [diff] [blame] | 64 | } // namespace content |
65 | |||||
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 66 | #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |