Commit efaa139d authored by Anastasia Helfinstein's avatar Anastasia Helfinstein Committed by Commit Bot

Make naming consistent between event handler types

Currently the EventHandler has methods start() and stop(), while the
RepeatedEventHandler has methods startListening() and stopListening().

Standardize on start() and stop().

TBR=akihiroota@chromium.org

AX-Relnotes: n/a.
Bug: None
Change-Id: Iac26647a9f218e4ce3f838ee74575a1de542d3f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2415408Reviewed-by: default avatarAnastasia Helfinstein <anastasi@google.com>
Commit-Queue: Anastasia Helfinstein <anastasi@google.com>
Cr-Commit-Position: refs/heads/master@{#808545}
parent 79a7989a
...@@ -58,11 +58,11 @@ class RepeatedEventHandler { ...@@ -58,11 +58,11 @@ class RepeatedEventHandler {
/** @private {!function(!chrome.automation.AutomationEvent)} */ /** @private {!function(!chrome.automation.AutomationEvent)} */
this.handler_ = this.onEvent_.bind(this); this.handler_ = this.onEvent_.bind(this);
this.startListening(); this.start();
} }
/** Starts listening or handling events. */ /** Starts listening or handling events. */
startListening() { start() {
if (this.listening_) { if (this.listening_) {
return; return;
} }
...@@ -73,7 +73,7 @@ class RepeatedEventHandler { ...@@ -73,7 +73,7 @@ class RepeatedEventHandler {
} }
/** Stops listening or handling future events. */ /** Stops listening or handling future events. */
stopListening() { stop() {
if (!this.listening_) { if (!this.listening_) {
return; return;
} }
......
...@@ -46,7 +46,7 @@ TEST_F( ...@@ -46,7 +46,7 @@ TEST_F(
repeatedHandler.onEvent_(); repeatedHandler.onEvent_();
repeatedHandler.onEvent_(); repeatedHandler.onEvent_();
repeatedHandler.stopListening(); repeatedHandler.stop();
// Yield before verifying how many times the handler was called. // Yield before verifying how many times the handler was called.
setTimeout( setTimeout(
......
...@@ -103,7 +103,7 @@ class BackButtonNode extends SAChildNode { ...@@ -103,7 +103,7 @@ class BackButtonNode extends SAChildNode {
false /* show */); false /* show */);
if (this.locationChangedHandler_) { if (this.locationChangedHandler_) {
this.locationChangedHandler_.stopListening(); this.locationChangedHandler_.stop();
} }
} }
......
...@@ -133,7 +133,7 @@ class BasicNode extends SAChildNode { ...@@ -133,7 +133,7 @@ class BasicNode extends SAChildNode {
onUnfocus() { onUnfocus() {
super.onUnfocus(); super.onUnfocus();
if (this.locationChangedHandler_) { if (this.locationChangedHandler_) {
this.locationChangedHandler_.stopListening(); this.locationChangedHandler_.stop();
} }
} }
...@@ -293,7 +293,7 @@ class BasicRootNode extends SARootNode { ...@@ -293,7 +293,7 @@ class BasicRootNode extends SARootNode {
onUnfocus() { onUnfocus() {
super.onUnfocus(); super.onUnfocus();
if (this.childrenChangedHandler_) { if (this.childrenChangedHandler_) {
this.childrenChangedHandler_.stopListening(); this.childrenChangedHandler_.stop();
} }
} }
......
...@@ -44,7 +44,7 @@ class ComboBoxNode extends BasicNode { ...@@ -44,7 +44,7 @@ class ComboBoxNode extends BasicNode {
super.onUnfocus(); super.onUnfocus();
if (this.expandedChangedHandler_) { if (this.expandedChangedHandler_) {
this.expandedChangedHandler_.stopListening(); this.expandedChangedHandler_.stop();
this.expandedChangedHandler_ = null; this.expandedChangedHandler_ = null;
} }
} }
......
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