Commit e2656f11 authored by Abigail Klein's avatar Abigail Klein Committed by Commit Bot

[chrome:accessibility] Rename route id to routing id.

Bug: 785493
Change-Id: I4522d70bcf2841dbd554bdae37bcfebbdc55239d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857542
Commit-Queue: Abigail Klein <abigailbklein@google.com>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711811}
parent 9ebcb7db
...@@ -63,8 +63,7 @@ static const char kPagesField[] = "pages"; ...@@ -63,8 +63,7 @@ static const char kPagesField[] = "pages";
static const char kPidField[] = "pid"; static const char kPidField[] = "pid";
static const char kProcessIdField[] = "processId"; static const char kProcessIdField[] = "processId";
static const char kRequestTypeField[] = "requestType"; static const char kRequestTypeField[] = "requestType";
// TODO rename to routingId to match the name elsewhere. static const char kRoutingIdField[] = "routingId";
static const char kRouteIdField[] = "routeId";
static const char kSessionIdField[] = "sessionId"; static const char kSessionIdField[] = "sessionId";
static const char kShouldRequestTreeField[] = "shouldRequestTree"; static const char kShouldRequestTreeField[] = "shouldRequestTree";
static const char kStartField[] = "start"; static const char kStartField[] = "start";
...@@ -97,13 +96,13 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor( ...@@ -97,13 +96,13 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
const std::string& name, const std::string& name,
const GURL& favicon_url, const GURL& favicon_url,
int process_id, int process_id,
int route_id, int routing_id,
ui::AXMode accessibility_mode, ui::AXMode accessibility_mode,
base::ProcessHandle handle = base::kNullProcessHandle) { base::ProcessHandle handle = base::kNullProcessHandle) {
std::unique_ptr<base::DictionaryValue> target_data( std::unique_ptr<base::DictionaryValue> target_data(
new base::DictionaryValue()); new base::DictionaryValue());
target_data->SetInteger(kProcessIdField, process_id); target_data->SetInteger(kProcessIdField, process_id);
target_data->SetInteger(kRouteIdField, route_id); target_data->SetInteger(kRoutingIdField, routing_id);
target_data->SetString(kUrlField, url.spec()); target_data->SetString(kUrlField, url.spec());
target_data->SetString(kNameField, net::EscapeForHTML(name)); target_data->SetString(kNameField, net::EscapeForHTML(name));
target_data->SetInteger(kPidField, base::GetProcId(handle)); target_data->SetInteger(kPidField, base::GetProcId(handle));
...@@ -388,13 +387,13 @@ void AccessibilityUIMessageHandler::ToggleAccessibility( ...@@ -388,13 +387,13 @@ void AccessibilityUIMessageHandler::ToggleAccessibility(
CHECK(args->GetDictionary(0, &data)); CHECK(args->GetDictionary(0, &data));
int process_id = *data->FindIntPath(kProcessIdField); int process_id = *data->FindIntPath(kProcessIdField);
int route_id = *data->FindIntPath(kRouteIdField); int routing_id = *data->FindIntPath(kRoutingIdField);
int mode = *data->FindIntPath(kModeIdField); int mode = *data->FindIntPath(kModeIdField);
bool should_request_tree = *data->FindBoolPath(kShouldRequestTreeField); bool should_request_tree = *data->FindBoolPath(kShouldRequestTreeField);
AllowJavascript(); AllowJavascript();
content::RenderViewHost* rvh = content::RenderViewHost* rvh =
content::RenderViewHost::FromID(process_id, route_id); content::RenderViewHost::FromID(process_id, routing_id);
if (!rvh) if (!rvh)
return; return;
content::WebContents* web_contents = content::WebContents* web_contents =
...@@ -424,7 +423,7 @@ void AccessibilityUIMessageHandler::ToggleAccessibility( ...@@ -424,7 +423,7 @@ void AccessibilityUIMessageHandler::ToggleAccessibility(
if (should_request_tree) { if (should_request_tree) {
base::DictionaryValue request_data; base::DictionaryValue request_data;
request_data.SetIntPath(kProcessIdField, process_id); request_data.SetIntPath(kProcessIdField, process_id);
request_data.SetIntPath(kRouteIdField, route_id); request_data.SetIntPath(kRoutingIdField, routing_id);
request_data.SetStringPath(kRequestTypeField, kShowOrRefreshTree); request_data.SetStringPath(kRequestTypeField, kShowOrRefreshTree);
base::ListValue request_args; base::ListValue request_args;
request_args.Append(std::move(request_data)); request_args.Append(std::move(request_data));
...@@ -504,7 +503,7 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree( ...@@ -504,7 +503,7 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
CHECK(args->GetDictionary(0, &data)); CHECK(args->GetDictionary(0, &data));
int process_id = *data->FindIntPath(kProcessIdField); int process_id = *data->FindIntPath(kProcessIdField);
int route_id = *data->FindIntPath(kRouteIdField); int routing_id = *data->FindIntPath(kRoutingIdField);
const std::string* request_type_p = data->FindStringPath(kRequestTypeField); const std::string* request_type_p = data->FindStringPath(kRequestTypeField);
CHECK(IsValidJSValue(request_type_p)); CHECK(IsValidJSValue(request_type_p));
...@@ -524,11 +523,11 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree( ...@@ -524,11 +523,11 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
AllowJavascript(); AllowJavascript();
content::RenderViewHost* rvh = content::RenderViewHost* rvh =
content::RenderViewHost::FromID(process_id, route_id); content::RenderViewHost::FromID(process_id, routing_id);
if (!rvh) { if (!rvh) {
std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue()); std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
result->SetInteger(kProcessIdField, process_id); result->SetInteger(kProcessIdField, process_id);
result->SetInteger(kRouteIdField, route_id); result->SetInteger(kRoutingIdField, routing_id);
result->SetString(kErrorField, "Renderer no longer exists."); result->SetString(kErrorField, "Renderer no longer exists.");
CallJavascriptFunction(request_type, *(result.get())); CallJavascriptFunction(request_type, *(result.get()));
return; return;
...@@ -631,13 +630,13 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents( ...@@ -631,13 +630,13 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
CHECK(args->GetDictionary(0, &data)); CHECK(args->GetDictionary(0, &data));
int process_id = *data->FindIntPath(kProcessIdField); int process_id = *data->FindIntPath(kProcessIdField);
int route_id = *data->FindIntPath(kRouteIdField); int routing_id = *data->FindIntPath(kRoutingIdField);
bool start = *data->FindBoolPath(kStartField); bool start = *data->FindBoolPath(kStartField);
AllowJavascript(); AllowJavascript();
content::RenderViewHost* rvh = content::RenderViewHost* rvh =
content::RenderViewHost::FromID(process_id, route_id); content::RenderViewHost::FromID(process_id, routing_id);
if (!rvh) { if (!rvh) {
return; return;
} }
......
...@@ -39,7 +39,7 @@ cr.define('accessibility', function() { ...@@ -39,7 +39,7 @@ cr.define('accessibility', function() {
function getIdFromData(data) { function getIdFromData(data) {
if (data.type == 'page') { if (data.type == 'page') {
return data.processId + '.' + data.routeId; return data.processId + '.' + data.routingId;
} else if (data.type == 'browser') { } else if (data.type == 'browser') {
return 'browser.' + data.sessionId; return 'browser.' + data.sessionId;
} else { } else {
...@@ -59,7 +59,7 @@ cr.define('accessibility', function() { ...@@ -59,7 +59,7 @@ cr.define('accessibility', function() {
const shouldRequestTree = !!tree && tree.style.display != 'none'; const shouldRequestTree = !!tree && tree.style.display != 'none';
chrome.send('toggleAccessibility', [{ chrome.send('toggleAccessibility', [{
'processId': data.processId, 'processId': data.processId,
'routeId': data.routeId, 'routingId': data.routingId,
'modeId': mode, 'modeId': mode,
'shouldRequestTree': shouldRequestTree 'shouldRequestTree': shouldRequestTree
}]); }]);
...@@ -93,7 +93,7 @@ cr.define('accessibility', function() { ...@@ -93,7 +93,7 @@ cr.define('accessibility', function() {
chrome.send( chrome.send(
'requestWebContentsTree', [{ 'requestWebContentsTree', [{
'processId': data.processId, 'processId': data.processId,
'routeId': data.routeId, 'routingId': data.routingId,
'requestType': requestType, 'requestType': requestType,
'filters': {'allow': allow, 'allowEmpty': allowEmpty, 'deny': deny} 'filters': {'allow': allow, 'allowEmpty': allowEmpty, 'deny': deny}
}]); }]);
...@@ -115,7 +115,7 @@ cr.define('accessibility', function() { ...@@ -115,7 +115,7 @@ cr.define('accessibility', function() {
// TODO Show all start recording elements. // TODO Show all start recording elements.
} }
chrome.send('requestAccessibilityEvents', [ chrome.send('requestAccessibilityEvents', [
{'processId': data.processId, 'routeId': data.routeId, 'start': start} {'processId': data.processId, 'routingId': data.routingId, 'start': start}
]); ]);
} }
...@@ -177,7 +177,7 @@ cr.define('accessibility', function() { ...@@ -177,7 +177,7 @@ cr.define('accessibility', function() {
formatRow(row, data); formatRow(row, data);
row.processId = data.processId; row.processId = data.processId;
row.routeId = data.routeId; row.routingId = data.routingId;
const pages = $('pages'); const pages = $('pages');
pages.appendChild(row); pages.appendChild(row);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment