| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_internal_
api.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/browser/web_contents_observer.h" | 37 #include "content/public/browser/web_contents_observer.h" |
| 38 #include "content/public/browser/web_contents_user_data.h" | 38 #include "content/public/browser/web_contents_user_data.h" |
| 39 #include "extensions/common/extension_messages.h" | 39 #include "extensions/common/extension_messages.h" |
| 40 #include "extensions/common/permissions/permissions_data.h" | 40 #include "extensions/common/permissions/permissions_data.h" |
| 41 #include "ui/accessibility/ax_action_data.h" | 41 #include "ui/accessibility/ax_action_data.h" |
| 42 #include "ui/accessibility/ax_host_delegate.h" | 42 #include "ui/accessibility/ax_host_delegate.h" |
| 43 #include "ui/accessibility/ax_tree_id_registry.h" | 43 #include "ui/accessibility/ax_tree_id_registry.h" |
| 44 | 44 |
| 45 #if defined(USE_AURA) | 45 #if defined(USE_AURA) |
| 46 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" | 46 #include "chrome/browser/ui/aura/accessibility/automation_manager_aura.h" |
| 47 #include "ui/aura/env.h" | |
| 48 #endif | 47 #endif |
| 49 | 48 |
| 50 namespace extensions { | 49 namespace extensions { |
| 51 class AutomationWebContentsObserver; | 50 class AutomationWebContentsObserver; |
| 52 } // namespace extensions | 51 } // namespace extensions |
| 53 | 52 |
| 54 DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::AutomationWebContentsObserver); | 53 DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::AutomationWebContentsObserver); |
| 55 | 54 |
| 56 namespace extensions { | 55 namespace extensions { |
| 57 | 56 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 void AccessibilityEventReceived( | 170 void AccessibilityEventReceived( |
| 172 const std::vector<content::AXEventNotificationDetails>& details) | 171 const std::vector<content::AXEventNotificationDetails>& details) |
| 173 override { | 172 override { |
| 174 for (const auto& event : details) { | 173 for (const auto& event : details) { |
| 175 ExtensionMsg_AccessibilityEventParams params; | 174 ExtensionMsg_AccessibilityEventParams params; |
| 176 params.tree_id = event.ax_tree_id; | 175 params.tree_id = event.ax_tree_id; |
| 177 params.id = event.id; | 176 params.id = event.id; |
| 178 params.event_type = event.event_type; | 177 params.event_type = event.event_type; |
| 179 params.update = event.update; | 178 params.update = event.update; |
| 180 params.event_from = event.event_from; | 179 params.event_from = event.event_from; |
| 181 #if defined(USE_AURA) | |
| 182 params.mouse_location = aura::Env::GetInstance()->last_mouse_location(); | |
| 183 #endif | |
| 184 | 180 |
| 185 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); | 181 AutomationEventRouter* router = AutomationEventRouter::GetInstance(); |
| 186 router->DispatchAccessibilityEvent(params); | 182 router->DispatchAccessibilityEvent(params); |
| 187 } | 183 } |
| 188 } | 184 } |
| 189 | 185 |
| 190 void AccessibilityLocationChangesReceived( | 186 void AccessibilityLocationChangesReceived( |
| 191 const std::vector<content::AXLocationChangeNotificationDetails>& details) | 187 const std::vector<content::AXLocationChangeNotificationDetails>& details) |
| 192 override { | 188 override { |
| 193 for (const auto& src : details) { | 189 for (const auto& src : details) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 int result_acc_obj_id) { | 520 int result_acc_obj_id) { |
| 525 if (!error.empty()) { | 521 if (!error.empty()) { |
| 526 Respond(Error(error)); | 522 Respond(Error(error)); |
| 527 return; | 523 return; |
| 528 } | 524 } |
| 529 | 525 |
| 530 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); | 526 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); |
| 531 } | 527 } |
| 532 | 528 |
| 533 } // namespace extensions | 529 } // namespace extensions |
| OLD | NEW |