Commit 6807dd3f authored by Katie D's avatar Katie D Committed by Commit Bot

Fix accessibility_common closure, add to closure_compile rule.

Bug: 1108171
Change-Id: I037f79720373b1d5d948109bbc283aeea2b8807e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2313379
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Auto-Submit: Katie Dektar <katie@chromium.org>
Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792158}
parent 98b8ad97
...@@ -36,6 +36,7 @@ grit("multidevice_setup_resources") { ...@@ -36,6 +36,7 @@ grit("multidevice_setup_resources") {
group("closure_compile") { group("closure_compile") {
deps = [ deps = [
"accessibility/accessibility_common:closure_compile",
"accessibility/braille_ime:closure_compile", "accessibility/braille_ime:closure_compile",
"accessibility/select_to_speak:closure_compile", "accessibility/select_to_speak:closure_compile",
"accessibility/switch_access:closure_compile", "accessibility/switch_access:closure_compile",
......
...@@ -73,15 +73,25 @@ js2gtest("accessibility_common_extjs_tests") { ...@@ -73,15 +73,25 @@ js2gtest("accessibility_common_extjs_tests") {
] ]
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ] defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
} }
#js_type_check("closure_compile") {
# deps = [ ":autoclick" ] js_type_check("closure_compile") {
#} deps = [ ":accessibility_common" ]
# }
# Doesn't build. See https://crbug.com/1108171.
#js_library("autoclick") { js_library("accessibility_common") {
# sources = [ "autoclick/autoclick.js" ] sources = [ "accessibility_common_loader.js" ]
# externs_list = [ deps = [ ":autoclick" ]
# "$externs_path/accessibility_private.js", externs_list = [
# "$externs_path/automation.js", "$externs_path/chrome_extensions.js",
# ] "$externs_path/accessibility_private.js",
#} "$externs_path/automation.js",
]
}
js_library("autoclick") {
sources = [ "autoclick/autoclick.js" ]
externs_list = [
"$externs_path/accessibility_private.js",
"$externs_path/automation.js",
]
}
...@@ -17,7 +17,7 @@ class AccessibilityCommon { ...@@ -17,7 +17,7 @@ class AccessibilityCommon {
} }
/** /**
* @public {Autoclick} * @return {Autoclick}
*/ */
getAutoclickForTest() { getAutoclickForTest() {
return this.autoclick_; return this.autoclick_;
......
...@@ -34,12 +34,12 @@ class Autoclick { ...@@ -34,12 +34,12 @@ class Autoclick {
this.desktop_; this.desktop_;
/** /**
* @private {function(number, number)} * @private {?function(number, number)}
*/ */
this.scrollableBoundsListener_ = null; this.scrollableBoundsListener_ = null;
/** /**
* @private {function(AutomationEvent)} * @private {?function(!chrome.automation.AutomationEvent)}
*/ */
this.hitTestListener_ = null; this.hitTestListener_ = null;
...@@ -52,16 +52,18 @@ class Autoclick { ...@@ -52,16 +52,18 @@ class Autoclick {
/** /**
* Destructor to remove any listeners. * Destructor to remove any listeners.
* @public
*/ */
onAutoclickDisabled() { onAutoclickDisabled() {
chrome.accessibilityPrivate.findScrollableBoundsForPoint.removeListener( if (this.scrollableBoundsListener_) {
this.scrollableBoundsListener_); chrome.accessibilityPrivate.findScrollableBoundsForPoint.removeListener(
this.scrollableBoundsListener_ = null; this.scrollableBoundsListener_);
this.scrollableBoundsListener_ = null;
}
if (this.desktop_) { if (this.desktop_ && this.hitTestListener_) {
this.desktop_.removeEventListener( this.desktop_.removeEventListener(
chrome.automation.EventType.MOUSE_PRESSED, this.hitTestListener_); chrome.automation.EventType.MOUSE_PRESSED, this.hitTestListener_,
true);
this.hitTestListener_ = null; this.hitTestListener_ = null;
} }
} }
...@@ -71,12 +73,12 @@ class Autoclick { ...@@ -71,12 +73,12 @@ class Autoclick {
* @private * @private
*/ */
init_() { init_() {
this.hitTestListener_ = this.onAutomationHitTestResult_.bind(this);
this.scrollableBoundsListener_ = this.scrollableBoundsListener_ =
this.findScrollingContainerForPoint_.bind(this); this.findScrollingContainerForPoint_.bind(this);
chrome.automation.getDesktop((desktop) => { chrome.automation.getDesktop((desktop) => {
this.desktop_ = desktop; this.desktop_ = desktop;
this.hitTestListener_ = this.onAutomationHitTestResult_.bind(this);
// We use a hit test at a point to determine what automation node is // We use a hit test at a point to determine what automation node is
// at that point, in order to find the scrollable area. // at that point, in order to find the scrollable area.
...@@ -126,6 +128,7 @@ class Autoclick { ...@@ -126,6 +128,7 @@ class Autoclick {
* Processes an automation hit test result. * Processes an automation hit test result.
* @param {!chrome.automation.AutomationEvent} event The hit test result * @param {!chrome.automation.AutomationEvent} event The hit test result
* event. * event.
* @private
*/ */
onAutomationHitTestResult_(event) { onAutomationHitTestResult_(event) {
// Walk up to the nearest scrollale area containing the point. // Walk up to the nearest scrollale area containing the point.
...@@ -170,6 +173,7 @@ class Autoclick { ...@@ -170,6 +173,7 @@ class Autoclick {
* Initiates finidng the nearest scrolling container for the given point. * Initiates finidng the nearest scrolling container for the given point.
* @param {number} x * @param {number} x
* @param {number} y * @param {number} y
* @private
*/ */
findScrollingContainerForPoint_(x, y) { findScrollingContainerForPoint_(x, y) {
// The hit test will come back through onAutmoationHitTestResult_, // The hit test will come back through onAutmoationHitTestResult_,
......
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