[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 | #pragma once |
8 | |||||
[email protected] | 20bb006 | 2010-10-06 21:24:37 | [diff] [blame] | 9 | #include <oleacc.h> |
10 | |||||
[email protected] | 8ee65ba | 2011-04-12 20:53:23 | [diff] [blame] | 11 | #include "base/win/scoped_comptr.h" |
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 12 | #include "content/browser/accessibility/browser_accessibility_manager.h" |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 13 | #include "webkit/glue/webaccessibility.h" |
14 | |||||
15 | class BrowserAccessibilityWin; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 16 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 17 | using webkit_glue::WebAccessibility; |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 18 | |
19 | // Manages a tree of BrowserAccessibilityWin objects. | ||||
20 | class BrowserAccessibilityManagerWin : public BrowserAccessibilityManager { | ||||
21 | public: | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 22 | virtual ~BrowserAccessibilityManagerWin(); |
23 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 24 | // Get a the default IAccessible for the parent window, does not make a |
25 | // new reference. | ||||
26 | IAccessible* GetParentWindowIAccessible(); | ||||
27 | |||||
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 28 | // BrowserAccessibilityManager methods |
[email protected] | a527a02 | 2011-02-10 02:32:36 | [diff] [blame] | 29 | virtual void NotifyAccessibilityEvent(int type, BrowserAccessibility* node); |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 30 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame^] | 31 | // Track this object and post a VISIBLE_DATA_CHANGED notification when |
32 | // its container scrolls. | ||||
33 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
34 | void TrackScrollingObject(BrowserAccessibilityWin* node); | ||||
35 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 36 | private: |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 37 | BrowserAccessibilityManagerWin( |
38 | HWND parent_window, | ||||
39 | const WebAccessibility& src, | ||||
40 | BrowserAccessibilityDelegate* delegate, | ||||
41 | BrowserAccessibilityFactory* factory); | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 42 | |
43 | // A default IAccessible instance for the parent window. | ||||
[email protected] | 8ee65ba | 2011-04-12 20:53:23 | [diff] [blame] | 44 | base::win::ScopedComPtr<IAccessible> window_iaccessible_; |
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 45 | |
[email protected] | f27e81c | 2010-10-07 05:20:23 | [diff] [blame] | 46 | // Give BrowserAccessibilityManager::Create access to our constructor. |
47 | friend class BrowserAccessibilityManager; | ||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 48 | |
[email protected] | b2ae783 | 2012-02-11 00:28:00 | [diff] [blame^] | 49 | // Track the most recent object that has been asked to scroll and |
50 | // post a notification directly on it when it reaches its destination. | ||||
51 | // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed. | ||||
52 | BrowserAccessibilityWin* tracked_scroll_object_; | ||||
53 | |||||
[email protected] | c5c2a67 | 2010-10-01 23:28:04 | [diff] [blame] | 54 | DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin); |
55 | }; | ||||
56 | |||||
[email protected] | ba1fa65 | 2011-06-25 05:16:22 | [diff] [blame] | 57 | #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |