Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: chrome/renderer/extensions/automation_internal_custom_bindings.cc

Issue 2238613002: Support output for Chrome's native find in ChromeVox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@text_markers
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 switch (tree_change_observer_overall_filter_) { 1210 switch (tree_change_observer_overall_filter_) {
1211 case api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES: 1211 case api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES:
1212 default: 1212 default:
1213 return; 1213 return;
1214 case api::automation::TREE_CHANGE_OBSERVER_FILTER_LIVEREGIONTREECHANGES: 1214 case api::automation::TREE_CHANGE_OBSERVER_FILTER_LIVEREGIONTREECHANGES:
1215 if (!node->data().HasStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_STATUS) && 1215 if (!node->data().HasStringAttribute(ui::AX_ATTR_CONTAINER_LIVE_STATUS) &&
1216 node->data().role != ui::AX_ROLE_ALERT) { 1216 node->data().role != ui::AX_ROLE_ALERT) {
1217 return; 1217 return;
1218 } 1218 }
1219 break; 1219 break;
1220 case api::automation::TREE_CHANGE_OBSERVER_FILTER_TEXTMARKERCHANGES:
1221 if (!node->data().HasIntListAttribute(ui::AX_ATTR_MARKER_TYPES))
1222 return;
1223 break;
1220 case api::automation::TREE_CHANGE_OBSERVER_FILTER_ALLTREECHANGES: 1224 case api::automation::TREE_CHANGE_OBSERVER_FILTER_ALLTREECHANGES:
1221 break; 1225 break;
1222 } 1226 }
1223 1227
1224 auto iter = axtree_to_tree_cache_map_.find(tree); 1228 auto iter = axtree_to_tree_cache_map_.find(tree);
1225 if (iter == axtree_to_tree_cache_map_.end()) 1229 if (iter == axtree_to_tree_cache_map_.end())
1226 return; 1230 return;
1227 1231
1228 int tree_id = iter->second->tree_id; 1232 int tree_id = iter->second->tree_id;
1229 1233
1230 v8::Isolate* isolate = GetIsolate(); 1234 v8::Isolate* isolate = GetIsolate();
1231 v8::HandleScope handle_scope(isolate); 1235 v8::HandleScope handle_scope(isolate);
1232 v8::Context::Scope context_scope(context()->v8_context()); 1236 v8::Context::Scope context_scope(context()->v8_context());
1233 1237
1234 for (const auto& observer : tree_change_observers_) { 1238 for (const auto& observer : tree_change_observers_) {
1235 switch (observer.filter) { 1239 switch (observer.filter) {
1236 case api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES: 1240 case api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES:
1237 default: 1241 default:
1238 continue; 1242 continue;
1239 case api::automation::TREE_CHANGE_OBSERVER_FILTER_LIVEREGIONTREECHANGES: 1243 case api::automation::TREE_CHANGE_OBSERVER_FILTER_LIVEREGIONTREECHANGES:
1240 if (!node->data().HasStringAttribute( 1244 if (!node->data().HasStringAttribute(
1241 ui::AX_ATTR_CONTAINER_LIVE_STATUS) && 1245 ui::AX_ATTR_CONTAINER_LIVE_STATUS) &&
1242 node->data().role != ui::AX_ROLE_ALERT) { 1246 node->data().role != ui::AX_ROLE_ALERT) {
1243 continue; 1247 continue;
1244 } 1248 }
1245 break; 1249 break;
1250 case api::automation::TREE_CHANGE_OBSERVER_FILTER_TEXTMARKERCHANGES:
1251 if (!node->data().HasIntListAttribute(ui::AX_ATTR_MARKER_TYPES))
1252 continue;
1253 break;
1246 case api::automation::TREE_CHANGE_OBSERVER_FILTER_ALLTREECHANGES: 1254 case api::automation::TREE_CHANGE_OBSERVER_FILTER_ALLTREECHANGES:
1247 break; 1255 break;
1248 } 1256 }
1249 1257
1250 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 4U)); 1258 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 4U));
1251 args->Set(0U, v8::Integer::New(GetIsolate(), observer.id)); 1259 args->Set(0U, v8::Integer::New(GetIsolate(), observer.id));
1252 args->Set(1U, v8::Integer::New(GetIsolate(), tree_id)); 1260 args->Set(1U, v8::Integer::New(GetIsolate(), tree_id));
1253 args->Set(2U, v8::Integer::New(GetIsolate(), node->id())); 1261 args->Set(2U, v8::Integer::New(GetIsolate(), node->id()));
1254 args->Set(3U, CreateV8String(isolate, ToString(change_type))); 1262 args->Set(3U, CreateV8String(isolate, ToString(change_type)));
1255 context()->DispatchEvent("automationInternal.onTreeChange", args); 1263 context()->DispatchEvent("automationInternal.onTreeChange", args);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); 1296 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U));
1289 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); 1297 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id));
1290 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); 1298 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size()));
1291 args->Set(1U, nodes); 1299 args->Set(1U, nodes);
1292 for (size_t i = 0; i < ids.size(); ++i) 1300 for (size_t i = 0; i < ids.size(); ++i)
1293 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); 1301 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i]));
1294 context()->DispatchEvent("automationInternal.onNodesRemoved", args); 1302 context()->DispatchEvent("automationInternal.onNodesRemoved", args);
1295 } 1303 }
1296 1304
1297 } // namespace extensions 1305 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698