| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou
ter.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_event_rou
ter.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/common/extensions/api/automation_api_constants.h" |
| 15 #include "chrome/common/extensions/api/automation_internal.h" | 16 #include "chrome/common/extensions/api/automation_internal.h" |
| 16 #include "chrome/common/extensions/chrome_extension_messages.h" | 17 #include "chrome/common/extensions/chrome_extension_messages.h" |
| 17 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
| 18 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/browser/notification_types.h" | 20 #include "content/public/browser/notification_types.h" |
| 20 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 21 #include "extensions/browser/event_router.h" | 22 #include "extensions/browser/event_router.h" |
| 22 #include "extensions/common/extension.h" | 23 #include "extensions/common/extension.h" |
| 23 #include "ui/accessibility/ax_enums.h" | 24 #include "ui/accessibility/ax_enums.h" |
| 24 #include "ui/accessibility/ax_node_data.h" | 25 #include "ui/accessibility/ax_node_data.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 55 false); | 56 false); |
| 56 } | 57 } |
| 57 | 58 |
| 58 void AutomationEventRouter::RegisterListenerWithDesktopPermission( | 59 void AutomationEventRouter::RegisterListenerWithDesktopPermission( |
| 59 const ExtensionId& extension_id, | 60 const ExtensionId& extension_id, |
| 60 int listener_process_id, | 61 int listener_process_id, |
| 61 int listener_routing_id) { | 62 int listener_routing_id) { |
| 62 Register(extension_id, | 63 Register(extension_id, |
| 63 listener_process_id, | 64 listener_process_id, |
| 64 listener_routing_id, | 65 listener_routing_id, |
| 65 0 /* desktop tree ID */, | 66 api::automation::kDesktopTreeID, |
| 66 true); | 67 true); |
| 67 } | 68 } |
| 68 | 69 |
| 69 void AutomationEventRouter::DispatchAccessibilityEvent( | 70 void AutomationEventRouter::DispatchAccessibilityEvent( |
| 70 const ExtensionMsg_AccessibilityEventParams& params) { | 71 const ExtensionMsg_AccessibilityEventParams& params) { |
| 71 if (active_profile_ != ProfileManager::GetActiveUserProfile()) { | 72 if (active_profile_ != ProfileManager::GetActiveUserProfile()) { |
| 72 active_profile_ = ProfileManager::GetActiveUserProfile(); | 73 active_profile_ = ProfileManager::GetActiveUserProfile(); |
| 73 UpdateActiveProfile(); | 74 UpdateActiveProfile(); |
| 74 } | 75 } |
| 75 | 76 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // only mark one as active. | 205 // only mark one as active. |
| 205 listener.is_active_profile = (extension_id_count == 1 || | 206 listener.is_active_profile = (extension_id_count == 1 || |
| 206 rph->GetBrowserContext() == active_profile_); | 207 rph->GetBrowserContext() == active_profile_); |
| 207 #else | 208 #else |
| 208 listener.is_active_profile = true; | 209 listener.is_active_profile = true; |
| 209 #endif | 210 #endif |
| 210 } | 211 } |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace extensions | 214 } // namespace extensions |
| OLD | NEW |