blob: 7857f68a76e312ba76f97f25dc6973be528d172d [file] [log] [blame]
[email protected]b2ae7832012-02-11 00:28:001// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]c5c2a672010-10-01 23:28:042// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]ba1fa652011-06-25 05:16:225#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
6#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_
[email protected]c5c2a672010-10-01 23:28:047
[email protected]20bb0062010-10-06 21:24:378#include <oleacc.h>
9
[email protected]8ee65ba2011-04-12 20:53:2310#include "base/win/scoped_comptr.h"
[email protected]ba1fa652011-06-25 05:16:2211#include "content/browser/accessibility/browser_accessibility_manager.h"
[email protected]c5c2a672010-10-01 23:28:0412
[email protected]e6b34872012-10-24 20:51:3213namespace content {
[email protected]c5c2a672010-10-01 23:28:0414class BrowserAccessibilityWin;
[email protected]c5c2a672010-10-01 23:28:0415
[email protected]c5c2a672010-10-01 23:28:0416// Manages a tree of BrowserAccessibilityWin objects.
[email protected]a6120e32013-03-15 11:07:3517class CONTENT_EXPORT BrowserAccessibilityManagerWin
18 : public BrowserAccessibilityManager {
[email protected]c5c2a672010-10-01 23:28:0419 public:
[email protected]a6120e32013-03-15 11:07:3520 BrowserAccessibilityManagerWin(
21 HWND parent_hwnd,
22 IAccessible* parent_iaccessible,
23 const AccessibilityNodeData& src,
24 BrowserAccessibilityDelegate* delegate,
25 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory());
26
[email protected]c5c2a672010-10-01 23:28:0427 virtual ~BrowserAccessibilityManagerWin();
28
[email protected]a6120e32013-03-15 11:07:3529 static AccessibilityNodeData GetEmptyDocument();
30
31 // Get the closest containing HWND.
[email protected]afe83752013-03-20 01:58:4132 HWND parent_hwnd() { return parent_hwnd_; }
[email protected]a6120e32013-03-15 11:07:3533
[email protected]afe83752013-03-20 01:58:4134 // 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]c5c2a672010-10-01 23:28:0439
[email protected]3144b892013-05-25 01:14:4540 // Calls NotifyWinEvent if the parent window's IAccessible pointer is known.
41 void MaybeCallNotifyWinEvent(DWORD event, LONG child_id);
42
[email protected]f27e81c2010-10-07 05:20:2343 // BrowserAccessibilityManager methods
[email protected]d1ba0192013-04-10 04:36:2244 virtual void AddNodeToMap(BrowserAccessibility* node);
45 virtual void RemoveNode(BrowserAccessibility* node) OVERRIDE;
[email protected]10760e4a2013-09-04 23:32:2046 virtual void NotifyAccessibilityEvent(
47 WebKit::WebAXEvent event_type, BrowserAccessibility* node) OVERRIDE;
[email protected]c5c2a672010-10-01 23:28:0448
[email protected]b2ae7832012-02-11 00:28:0049 // Track this object and post a VISIBLE_DATA_CHANGED notification when
50 // its container scrolls.
51 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed.
52 void TrackScrollingObject(BrowserAccessibilityWin* node);
53
[email protected]d1ba0192013-04-10 04:36:2254 // Return a pointer to the object corresponding to the given windows-specific
55 // unique id, does not make a new reference.
56 BrowserAccessibilityWin* GetFromUniqueIdWin(LONG unique_id_win);
57
[email protected]c5c2a672010-10-01 23:28:0458 private:
[email protected]a6120e32013-03-15 11:07:3559 // The closest ancestor HWND.
60 HWND parent_hwnd_;
[email protected]c5c2a672010-10-01 23:28:0461
[email protected]a6120e32013-03-15 11:07:3562 // The accessibility instance for the parent window.
63 IAccessible* parent_iaccessible_;
[email protected]c5c2a672010-10-01 23:28:0464
[email protected]f27e81c2010-10-07 05:20:2365 // Give BrowserAccessibilityManager::Create access to our constructor.
66 friend class BrowserAccessibilityManager;
[email protected]c5c2a672010-10-01 23:28:0467
[email protected]b2ae7832012-02-11 00:28:0068 // Track the most recent object that has been asked to scroll and
69 // post a notification directly on it when it reaches its destination.
70 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed.
71 BrowserAccessibilityWin* tracked_scroll_object_;
72
[email protected]d1ba0192013-04-10 04:36:2273 // A mapping from the Windows-specific unique IDs (unique within the
74 // browser process) to renderer ids within this page.
75 base::hash_map<long, int32> unique_id_to_renderer_id_map_;
76
[email protected]c5c2a672010-10-01 23:28:0477 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin);
78};
79
[email protected]e6b34872012-10-24 20:51:3280} // namespace content
81
[email protected]ba1fa652011-06-25 05:16:2282#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_