| 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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 v8::HandleScope handle_scope(isolate); | 1117 v8::HandleScope handle_scope(isolate); |
| 1118 v8::Context::Scope context_scope(context()->v8_context()); | 1118 v8::Context::Scope context_scope(context()->v8_context()); |
| 1119 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 1U)); | 1119 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 1U)); |
| 1120 v8::Local<v8::Object> event_params(v8::Object::New(GetIsolate())); | 1120 v8::Local<v8::Object> event_params(v8::Object::New(GetIsolate())); |
| 1121 event_params->Set(CreateV8String(isolate, "treeID"), | 1121 event_params->Set(CreateV8String(isolate, "treeID"), |
| 1122 v8::Integer::New(GetIsolate(), params.tree_id)); | 1122 v8::Integer::New(GetIsolate(), params.tree_id)); |
| 1123 event_params->Set(CreateV8String(isolate, "targetID"), | 1123 event_params->Set(CreateV8String(isolate, "targetID"), |
| 1124 v8::Integer::New(GetIsolate(), params.id)); | 1124 v8::Integer::New(GetIsolate(), params.id)); |
| 1125 event_params->Set(CreateV8String(isolate, "eventType"), | 1125 event_params->Set(CreateV8String(isolate, "eventType"), |
| 1126 CreateV8String(isolate, ToString(params.event_type))); | 1126 CreateV8String(isolate, ToString(params.event_type))); |
| 1127 event_params->Set(CreateV8String(isolate, "eventFrom"), |
| 1128 CreateV8String(isolate, ToString(params.event_from))); |
| 1127 args->Set(0U, event_params); | 1129 args->Set(0U, event_params); |
| 1128 context()->DispatchEvent("automationInternal.onAccessibilityEvent", args); | 1130 context()->DispatchEvent("automationInternal.onAccessibilityEvent", args); |
| 1129 } | 1131 } |
| 1130 | 1132 |
| 1131 void AutomationInternalCustomBindings::OnAccessibilityLocationChange( | 1133 void AutomationInternalCustomBindings::OnAccessibilityLocationChange( |
| 1132 const ExtensionMsg_AccessibilityLocationChangeParams& params) { | 1134 const ExtensionMsg_AccessibilityLocationChangeParams& params) { |
| 1133 int tree_id = params.tree_id; | 1135 int tree_id = params.tree_id; |
| 1134 auto iter = tree_id_to_tree_cache_map_.find(tree_id); | 1136 auto iter = tree_id_to_tree_cache_map_.find(tree_id); |
| 1135 if (iter == tree_id_to_tree_cache_map_.end()) | 1137 if (iter == tree_id_to_tree_cache_map_.end()) |
| 1136 return; | 1138 return; |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); | 1352 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); |
| 1351 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); | 1353 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); |
| 1352 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); | 1354 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); |
| 1353 args->Set(1U, nodes); | 1355 args->Set(1U, nodes); |
| 1354 for (size_t i = 0; i < ids.size(); ++i) | 1356 for (size_t i = 0; i < ids.size(); ++i) |
| 1355 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); | 1357 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); |
| 1356 context()->DispatchEvent("automationInternal.onNodesRemoved", args); | 1358 context()->DispatchEvent("automationInternal.onNodesRemoved", args); |
| 1357 } | 1359 } |
| 1358 | 1360 |
| 1359 } // namespace extensions | 1361 } // namespace extensions |
| OLD | NEW |