blob: e82f0656a9c877b2cff0495becfc81df7143f9d2 [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]f27e81c2010-10-07 05:20:2340 // BrowserAccessibilityManager methods
[email protected]d1ba0192013-04-10 04:36:2241 virtual void AddNodeToMap(BrowserAccessibility* node);
42 virtual void RemoveNode(BrowserAccessibility* node) OVERRIDE;
43 virtual void NotifyAccessibilityEvent(int type, BrowserAccessibility* node)
44 OVERRIDE;
[email protected]c5c2a672010-10-01 23:28:0445
[email protected]b2ae7832012-02-11 00:28:0046 // Track this object and post a VISIBLE_DATA_CHANGED notification when
47 // its container scrolls.
48 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed.
49 void TrackScrollingObject(BrowserAccessibilityWin* node);
50
[email protected]d1ba0192013-04-10 04:36:2251 // Return a pointer to the object corresponding to the given windows-specific
52 // unique id, does not make a new reference.
53 BrowserAccessibilityWin* GetFromUniqueIdWin(LONG unique_id_win);
54
[email protected]c5c2a672010-10-01 23:28:0455 private:
[email protected]a6120e32013-03-15 11:07:3556 // The closest ancestor HWND.
57 HWND parent_hwnd_;
[email protected]c5c2a672010-10-01 23:28:0458
[email protected]a6120e32013-03-15 11:07:3559 // The accessibility instance for the parent window.
60 IAccessible* parent_iaccessible_;
[email protected]c5c2a672010-10-01 23:28:0461
[email protected]f27e81c2010-10-07 05:20:2362 // Give BrowserAccessibilityManager::Create access to our constructor.
63 friend class BrowserAccessibilityManager;
[email protected]c5c2a672010-10-01 23:28:0464
[email protected]b2ae7832012-02-11 00:28:0065 // Track the most recent object that has been asked to scroll and
66 // post a notification directly on it when it reaches its destination.
67 // TODO(dmazzoni): remove once http://crbug.com/113483 is fixed.
68 BrowserAccessibilityWin* tracked_scroll_object_;
69
[email protected]d1ba0192013-04-10 04:36:2270 // A mapping from the Windows-specific unique IDs (unique within the
71 // browser process) to renderer ids within this page.
72 base::hash_map<long, int32> unique_id_to_renderer_id_map_;
73
[email protected]c5c2a672010-10-01 23:28:0474 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManagerWin);
75};
76
[email protected]e6b34872012-10-24 20:51:3277} // namespace content
78
[email protected]ba1fa652011-06-25 05:16:2279#endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_