Commit 1b33428c authored by Josiah K's avatar Josiah K Committed by Commit Bot

Rename findScrollableBoundsForPoint to onScrollableBoundsForPointRequested

(Fixing accessibilityPrivate.on* names to only be used for events 2/3)

No functional changes - should be mechanical only.

AX-Relnotes: N/A
Change-Id: Ie31e44e0cdcce932865f2039c4cac5f9b6f9cb38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2422651
Auto-Submit: Josiah Krutz <josiahk@google.com>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#809574}
parent 6798b48d
...@@ -673,15 +673,15 @@ void AccessibilityManager::RequestAutoclickScrollableBoundsForPoint( ...@@ -673,15 +673,15 @@ void AccessibilityManager::RequestAutoclickScrollableBoundsForPoint(
gfx::Point& point_in_screen) { gfx::Point& point_in_screen) {
extensions::EventRouter* event_router = extensions::EventRouter* event_router =
extensions::EventRouter::Get(profile_); extensions::EventRouter::Get(profile_);
std::unique_ptr<base::ListValue> event_args = std::unique_ptr<base::ListValue> event_args = extensions::api::
extensions::api::accessibility_private::FindScrollableBoundsForPoint:: accessibility_private::OnScrollableBoundsForPointRequested::Create(
Create(point_in_screen.x(), point_in_screen.y()); point_in_screen.x(), point_in_screen.y());
std::unique_ptr<extensions::Event> event = std::unique_ptr<extensions::Event> event =
std::make_unique<extensions::Event>( std::make_unique<extensions::Event>(
extensions::events:: extensions::events::
ACCESSIBILITY_PRIVATE_FIND_SCROLLABLE_BOUNDS_FOR_POINT, ACCESSIBILITY_PRIVATE_FIND_SCROLLABLE_BOUNDS_FOR_POINT,
extensions::api::accessibility_private::FindScrollableBoundsForPoint:: extensions::api::accessibility_private::
kEventName, OnScrollableBoundsForPointRequested::kEventName,
std::move(event_args)); std::move(event_args));
event_router->DispatchEventWithLazyListener( event_router->DispatchEventWithLazyListener(
extension_misc::kAccessibilityCommonExtensionId, std::move(event)); extension_misc::kAccessibilityCommonExtensionId, std::move(event));
......
...@@ -55,8 +55,8 @@ class Autoclick { ...@@ -55,8 +55,8 @@ class Autoclick {
*/ */
onAutoclickDisabled() { onAutoclickDisabled() {
if (this.scrollableBoundsListener_) { if (this.scrollableBoundsListener_) {
chrome.accessibilityPrivate.findScrollableBoundsForPoint.removeListener( chrome.accessibilityPrivate.onScrollableBoundsForPointRequested
this.scrollableBoundsListener_); .removeListener(this.scrollableBoundsListener_);
this.scrollableBoundsListener_ = null; this.scrollableBoundsListener_ = null;
} }
...@@ -87,7 +87,7 @@ class Autoclick { ...@@ -87,7 +87,7 @@ class Autoclick {
true); true);
}); });
chrome.accessibilityPrivate.findScrollableBoundsForPoint.addListener( chrome.accessibilityPrivate.onScrollableBoundsForPointRequested.addListener(
this.scrollableBoundsListener_); this.scrollableBoundsListener_);
} }
......
...@@ -66,7 +66,7 @@ TEST_F('AutoclickE2ETest', 'HighlightsRootWebAreaIfNotScrollable', function() { ...@@ -66,7 +66,7 @@ TEST_F('AutoclickE2ETest', 'HighlightsRootWebAreaIfNotScrollable', function() {
'data:text/html;charset=utf-8,<p>Cats rock!</p>', function(desktop) { 'data:text/html;charset=utf-8,<p>Cats rock!</p>', function(desktop) {
const node = desktop.find( const node = desktop.find(
{role: 'staticText', attributes: {name: 'Cats rock!'}}); {role: 'staticText', attributes: {name: 'Cats rock!'}});
this.mockAccessibilityPrivate.callFindScrollableBoundsForPoint( this.mockAccessibilityPrivate.callOnScrollableBoundsForPointRequested(
// Offset slightly into the node to ensure the hittest // Offset slightly into the node to ensure the hittest
// happens within the node. // happens within the node.
node.location.left + 1, node.location.top + 1, node.location.left + 1, node.location.top + 1,
...@@ -92,7 +92,7 @@ TEST_F('AutoclickE2ETest', 'HighlightsScrollableDiv', function() { ...@@ -92,7 +92,7 @@ TEST_F('AutoclickE2ETest', 'HighlightsScrollableDiv', function() {
role: 'staticText', role: 'staticText',
attributes: {name: 'cats rock! this text wraps and overflows!'} attributes: {name: 'cats rock! this text wraps and overflows!'}
}); });
this.mockAccessibilityPrivate.callFindScrollableBoundsForPoint( this.mockAccessibilityPrivate.callOnScrollableBoundsForPointRequested(
// Offset slightly into the node to ensure the hittest happens // Offset slightly into the node to ensure the hittest happens
// within the node. // within the node.
node.location.left + 1, node.location.top + 1, node.location.left + 1, node.location.top + 1,
...@@ -118,7 +118,8 @@ TEST_F('AutoclickE2ETest', 'RemovesAndAddsAutoclick', function() { ...@@ -118,7 +118,8 @@ TEST_F('AutoclickE2ETest', 'RemovesAndAddsAutoclick', function() {
chrome.accessibilityFeatures.autoclick.set({value: true}, () => { chrome.accessibilityFeatures.autoclick.set({value: true}, () => {
const node = desktop.find( const node = desktop.find(
{role: 'staticText', attributes: {name: 'Cats rock!'}}); {role: 'staticText', attributes: {name: 'Cats rock!'}});
this.mockAccessibilityPrivate.callFindScrollableBoundsForPoint( this.mockAccessibilityPrivate
.callOnScrollableBoundsForPointRequested(
// Offset slightly into the node to ensure the hittest // Offset slightly into the node to ensure the hittest
// happens within the node. // happens within the node.
node.location.left + 1, node.location.top + 1, node.location.left + 1, node.location.top + 1,
......
...@@ -22,9 +22,9 @@ var MockAccessibilityPrivate = { ...@@ -22,9 +22,9 @@ var MockAccessibilityPrivate = {
// Methods from AccessibilityPrivate API. // // Methods from AccessibilityPrivate API. //
findScrollableBoundsForPoint: { onScrollableBoundsForPointRequested: {
/** /**
* Adds a listener to findScrollableBoundsForPoint. * Adds a listener to onScrollableBoundsForPointRequested.
* @param {function<number, number>} listener * @param {function<number, number>} listener
*/ */
addListener: (listener) => { addListener: (listener) => {
...@@ -73,7 +73,7 @@ var MockAccessibilityPrivate = { ...@@ -73,7 +73,7 @@ var MockAccessibilityPrivate = {
* @param {number} y * @param {number} y
* @param {!function<>} onScrollableBoundsForPointFoundCallback * @param {!function<>} onScrollableBoundsForPointFoundCallback
*/ */
callFindScrollableBoundsForPoint: callOnScrollableBoundsForPointRequested:
(x, y, onScrollableBoundsForPointFoundCallback) => { (x, y, onScrollableBoundsForPointFoundCallback) => {
onScrollableBoundsForPointFoundCallback_ = onScrollableBoundsForPointFoundCallback_ =
onScrollableBoundsForPointFoundCallback; onScrollableBoundsForPointFoundCallback;
......
...@@ -398,7 +398,7 @@ ...@@ -398,7 +398,7 @@
{ {
"name": "onScrollableBoundsForPointFound", "name": "onScrollableBoundsForPointFound",
"type": "function", "type": "function",
"description": "Called by the Accessibility Common extension when findScrollableBoundsForPoint has found a scrolling container. |rect| will be the bounds of the nearest scrollable ancestor of the node at the point requested using findScrollableBoundsForPoint.", "description": "Called by the Accessibility Common extension when onScrollableBoundsForPointRequested has found a scrolling container. |rect| will be the bounds of the nearest scrollable ancestor of the node at the point requested using onScrollableBoundsForPointRequested.",
"parameters": [ "parameters": [
{ {
"name": "rect", "name": "rect",
...@@ -522,7 +522,7 @@ ...@@ -522,7 +522,7 @@
"platforms": ["chromeos"] "platforms": ["chromeos"]
}, },
{ {
"name": "findScrollableBoundsForPoint", "name": "onScrollableBoundsForPointRequested",
"type": "function", "type": "function",
"description": "Fired when an internal component within accessibility wants to find the nearest scrolling container at a given screen coordinate. Used in Automatic Clicks.", "description": "Fired when an internal component within accessibility wants to find the nearest scrolling container at a given screen coordinate. Used in Automatic Clicks.",
"parameters": [ "parameters": [
......
...@@ -307,9 +307,9 @@ chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {}; ...@@ -307,9 +307,9 @@ chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {};
/** /**
* Called by the Accessibility Common extension when * Called by the Accessibility Common extension when
* findScrollableBoundsForPoint has found a scrolling container. |rect| will be * onScrollableBoundsForPointRequested has found a scrolling container. |rect| will be
* the bounds of the nearest scrollable ancestor of the node at the point * the bounds of the nearest scrollable ancestor of the node at the point
* requested using findScrollableBoundsForPoint. * requested using onScrollableBoundsForPointRequested.
* @param {!chrome.accessibilityPrivate.ScreenRect} rect * @param {!chrome.accessibilityPrivate.ScreenRect} rect
*/ */
chrome.accessibilityPrivate.onScrollableBoundsForPointFound = function(rect) {}; chrome.accessibilityPrivate.onScrollableBoundsForPointFound = function(rect) {};
...@@ -394,7 +394,7 @@ chrome.accessibilityPrivate.onAnnounceForAccessibility; ...@@ -394,7 +394,7 @@ chrome.accessibilityPrivate.onAnnounceForAccessibility;
* Clicks. * Clicks.
* @type {!ChromeEvent} * @type {!ChromeEvent}
*/ */
chrome.accessibilityPrivate.findScrollableBoundsForPoint; chrome.accessibilityPrivate.onScrollableBoundsForPointRequested;
/** /**
* Fired when a custom spoken feedback on the active window gets enabled or * Fired when a custom spoken feedback on the active window gets enabled or
......
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