Chromium Code Reviews| Index: chrome/browser/extensions/api/automation_internal/automation_event_router.h |
| diff --git a/chrome/browser/extensions/api/automation_internal/automation_event_router.h b/chrome/browser/extensions/api/automation_internal/automation_event_router.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4dac480dad4361d1ce95bd6e5efc036cc0ce027f |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/automation_internal/automation_event_router.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/containers/hash_tables.h" |
| +#include "base/memory/singleton.h" |
| +#include "chrome/common/extensions/api/automation_internal.h" |
| +#include "content/public/browser/ax_event_notification_details.h" |
| +#include "content/public/browser/notification_observer.h" |
| +#include "content/public/browser/notification_registrar.h" |
| +#include "extensions/common/extension.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +} // namespace content |
| + |
| +struct ExtensionMsg_AccessibilityEventParams; |
| + |
| +namespace extensions { |
| + |
| +struct AutomationListener; |
| + |
| +class AutomationEventRouter : public content::NotificationObserver { |
| + public: |
| + static AutomationEventRouter* GetInstance(); |
| + |
| + 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
|
| + int ax_tree_id, |
| + int process_id, |
| + int routing_id, |
| + bool desktop); |
| + |
| + void DispatchAccessibilityEventToAutomation( |
| + const ExtensionMsg_AccessibilityEventParams& params); |
| + |
| + void DispatchTreeDestroyedEventToAutomation( |
| + int process_id, |
| + int routing_id, |
| + content::BrowserContext* browser_context); |
| + |
| + private: |
| + AutomationEventRouter(); |
| + ~AutomationEventRouter() override; |
| + |
| + // content::NotificationObserver interface. |
| + void Observe(int type, |
| + const content::NotificationSource& source, |
| + const content::NotificationDetails& details) override; |
| + |
| + content::NotificationRegistrar registrar_; |
| + base::hash_map<ExtensionId, AutomationListener*> listener_map_; |
| + |
| + friend struct DefaultSingletonTraits<AutomationEventRouter>; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AutomationEventRouter); |
| +}; |
| + |
| +} // namespace extensions |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOMATION_INTERNAL_AUTOMATION_EVENT_ROUTER_H_ |