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 |
index 1389b43205944e6b76b9c728074c2a54b3bd1f41..1f2d51110d149b88c5b5d509072fed1352607016 100644 |
--- a/chrome/browser/extensions/api/automation_internal/automation_event_router.h |
+++ b/chrome/browser/extensions/api/automation_internal/automation_event_router.h |
@@ -14,6 +14,12 @@ |
#include "content/public/browser/notification_registrar.h" |
#include "extensions/common/extension.h" |
+#if defined(OS_CHROMEOS) |
+#include "ash/session/session_state_observer.h" |
+#endif |
+ |
+class Profile; |
+ |
namespace content { |
class BrowserContext; |
} // namespace content |
@@ -24,7 +30,12 @@ namespace extensions { |
struct AutomationListener; |
-class AutomationEventRouter : public content::NotificationObserver { |
+class AutomationEventRouter |
+ : public content::NotificationObserver |
+#if defined(OS_CHROMEOS) |
David Tseng
2015/08/05 22:24:36
USE_ASH?
|
+ , public ash::SessionStateObserver |
+#endif |
+{ |
public: |
static AutomationEventRouter* GetInstance(); |
@@ -32,14 +43,16 @@ class AutomationEventRouter : public content::NotificationObserver { |
// wants to receive automation events from the accessibility tree indicated |
// by |source_ax_tree_id|. Automation events are forwarded from now on |
// until the listener process dies. |
- void RegisterListenerForOneTree(int listener_process_id, |
+ void RegisterListenerForOneTree(const ExtensionId& extension_id, |
+ int listener_process_id, |
int listener_routing_id, |
int source_ax_tree_id); |
// Indicates that the listener at |listener_process_id|, |listener_routing_id| |
// wants to receive automation events from all accessibility trees because |
// it has Desktop permission. |
- void RegisterListenerWithDesktopPermission(int listener_process_id, |
+ void RegisterListenerWithDesktopPermission(const ExtensionId& extension_id, |
+ int listener_process_id, |
int listener_routing_id); |
void DispatchAccessibilityEvent( |
@@ -56,16 +69,19 @@ class AutomationEventRouter : public content::NotificationObserver { |
AutomationListener(); |
~AutomationListener(); |
+ ExtensionId extension_id; |
int routing_id; |
int process_id; |
bool desktop; |
std::set<int> tree_ids; |
+ bool is_active_profile; |
}; |
AutomationEventRouter(); |
~AutomationEventRouter() override; |
void Register( |
+ const ExtensionId& extension_id, |
int listener_process_id, |
int listener_routing_id, |
int source_ax_tree_id, |
@@ -76,9 +92,20 @@ class AutomationEventRouter : public content::NotificationObserver { |
const content::NotificationSource& source, |
const content::NotificationDetails& details) override; |
+ // SessionStateObserver overrides: |
+ void ActiveUserChanged(const std::string& user_id) override; |
+ |
+ void UpdateActiveProfile(); |
David Tseng
2015/08/05 22:24:36
nit: comment?
dmazzoni
2015/08/05 22:53:39
Done.
|
+ |
content::NotificationRegistrar registrar_; |
std::vector<AutomationListener> listeners_; |
+ Profile* active_profile_; |
+ |
+#if defined(OS_CHROMEOS) |
+ scoped_ptr<ash::ScopedSessionStateObserver> session_state_observer_; |
+#endif |
+ |
friend struct DefaultSingletonTraits<AutomationEventRouter>; |
DISALLOW_COPY_AND_ASSIGN(AutomationEventRouter); |