| 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/renderer/extensions/automation_internal_custom_bindings.h" | 5 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 1U)); | 1163 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 1U)); |
| 1164 v8::Local<v8::Object> event_params(v8::Object::New(GetIsolate())); | 1164 v8::Local<v8::Object> event_params(v8::Object::New(GetIsolate())); |
| 1165 event_params->Set(CreateV8String(isolate, "treeID"), | 1165 event_params->Set(CreateV8String(isolate, "treeID"), |
| 1166 v8::Integer::New(GetIsolate(), params.tree_id)); | 1166 v8::Integer::New(GetIsolate(), params.tree_id)); |
| 1167 event_params->Set(CreateV8String(isolate, "targetID"), | 1167 event_params->Set(CreateV8String(isolate, "targetID"), |
| 1168 v8::Integer::New(GetIsolate(), params.id)); | 1168 v8::Integer::New(GetIsolate(), params.id)); |
| 1169 event_params->Set(CreateV8String(isolate, "eventType"), | 1169 event_params->Set(CreateV8String(isolate, "eventType"), |
| 1170 CreateV8String(isolate, ToString(params.event_type))); | 1170 CreateV8String(isolate, ToString(params.event_type))); |
| 1171 event_params->Set(CreateV8String(isolate, "eventFrom"), | 1171 event_params->Set(CreateV8String(isolate, "eventFrom"), |
| 1172 CreateV8String(isolate, ToString(params.event_from))); | 1172 CreateV8String(isolate, ToString(params.event_from))); |
| 1173 event_params->Set(CreateV8String(isolate, "mouseX"), |
| 1174 v8::Integer::New(GetIsolate(), params.mouse_location.x())); |
| 1175 event_params->Set(CreateV8String(isolate, "mouseY"), |
| 1176 v8::Integer::New(GetIsolate(), params.mouse_location.y())); |
| 1173 args->Set(0U, event_params); | 1177 args->Set(0U, event_params); |
| 1174 context()->DispatchEvent("automationInternal.onAccessibilityEvent", args); | 1178 context()->DispatchEvent("automationInternal.onAccessibilityEvent", args); |
| 1175 } | 1179 } |
| 1176 | 1180 |
| 1177 void AutomationInternalCustomBindings::OnAccessibilityLocationChange( | 1181 void AutomationInternalCustomBindings::OnAccessibilityLocationChange( |
| 1178 const ExtensionMsg_AccessibilityLocationChangeParams& params) { | 1182 const ExtensionMsg_AccessibilityLocationChangeParams& params) { |
| 1179 int tree_id = params.tree_id; | 1183 int tree_id = params.tree_id; |
| 1180 auto iter = tree_id_to_tree_cache_map_.find(tree_id); | 1184 auto iter = tree_id_to_tree_cache_map_.find(tree_id); |
| 1181 if (iter == tree_id_to_tree_cache_map_.end()) | 1185 if (iter == tree_id_to_tree_cache_map_.end()) |
| 1182 return; | 1186 return; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); | 1400 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); |
| 1397 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); | 1401 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); |
| 1398 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); | 1402 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); |
| 1399 args->Set(1U, nodes); | 1403 args->Set(1U, nodes); |
| 1400 for (size_t i = 0; i < ids.size(); ++i) | 1404 for (size_t i = 0; i < ids.size(); ++i) |
| 1401 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); | 1405 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); |
| 1402 context()->DispatchEvent("automationInternal.onNodesRemoved", args); | 1406 context()->DispatchEvent("automationInternal.onNodesRemoved", args); |
| 1403 } | 1407 } |
| 1404 | 1408 |
| 1405 } // namespace extensions | 1409 } // namespace extensions |
| OLD | NEW |