OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTE R_H_ | |
6 #define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTE R_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/containers/hash_tables.h" | |
11 #include "base/memory/singleton.h" | |
12 #include "chrome/common/extensions/api/automation_internal.h" | |
13 #include "content/public/browser/ax_event_notification_details.h" | |
14 #include "content/public/browser/notification_observer.h" | |
15 #include "content/public/browser/notification_registrar.h" | |
16 #include "extensions/common/extension.h" | |
17 | |
18 namespace content { | |
19 class BrowserContext; | |
20 } // namespace content | |
21 | |
22 struct ExtensionMsg_AccessibilityEventParams; | |
23 | |
24 namespace extensions { | |
25 | |
26 struct AutomationListener; | |
27 | |
28 class AutomationEventRouter : public content::NotificationObserver { | |
29 public: | |
30 static AutomationEventRouter* GetInstance(); | |
31 | |
32 void AddListener(ExtensionId extension_id, | |
not at google - send to devlin
2015/06/02 23:59:24
mention when it's removed.
dmazzoni
2015/06/04 20:07:39
Done. Note that the current automation API doesn't
| |
33 int ax_tree_id, | |
34 int process_id, | |
35 int routing_id, | |
36 bool desktop); | |
37 | |
38 void DispatchAccessibilityEventToAutomation( | |
39 const ExtensionMsg_AccessibilityEventParams& params); | |
40 | |
41 void DispatchTreeDestroyedEventToAutomation( | |
42 int process_id, | |
43 int routing_id, | |
44 content::BrowserContext* browser_context); | |
45 | |
46 private: | |
47 AutomationEventRouter(); | |
48 ~AutomationEventRouter() override; | |
49 | |
50 // content::NotificationObserver interface. | |
51 void Observe(int type, | |
52 const content::NotificationSource& source, | |
53 const content::NotificationDetails& details) override; | |
54 | |
55 content::NotificationRegistrar registrar_; | |
56 base::hash_map<ExtensionId, AutomationListener*> listener_map_; | |
57 | |
58 friend struct DefaultSingletonTraits<AutomationEventRouter>; | |
59 | |
60 DISALLOW_COPY_AND_ASSIGN(AutomationEventRouter); | |
61 }; | |
62 | |
63 } // namespace extensions | |
64 | |
65 #endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_RO UTER_H_ | |
OLD | NEW |