| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
| 6 * @fileoverview Basic facillities to handle events from a single automation | 6 * @fileoverview Basic facillities to handle events from a single automation |
| 7 * node. | 7 * node. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('BaseAutomationHandler'); | 10 goog.provide('BaseAutomationHandler'); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * Maps an automation event to its listener. | 28 * Maps an automation event to its listener. |
| 29 * @type {!Object<EventType, function(Object) : void>} | 29 * @type {!Object<EventType, function(Object) : void>} |
| 30 */ | 30 */ |
| 31 this.listenerMap_ = { | 31 this.listenerMap_ = { |
| 32 alert: this.onAlert, | 32 alert: this.onAlert, |
| 33 focus: this.onFocus, | 33 focus: this.onFocus, |
| 34 hover: this.onEventDefault, | 34 hover: this.onEventDefault, |
| 35 loadComplete: this.onLoadComplete, | 35 loadComplete: this.onLoadComplete, |
| 36 menuStart: this.onEventDefault, | 36 menuStart: this.onEventDefault, |
| 37 menuEnd: this.onEventDefault, | 37 menuEnd: this.onEventDefault, |
| 38 scrollPositionChanged: this.onScrollPositionChanged, |
| 38 textChanged: this.onTextOrTextSelectionChanged, | 39 textChanged: this.onTextOrTextSelectionChanged, |
| 39 textSelectionChanged: this.onTextOrTextSelectionChanged, | 40 textSelectionChanged: this.onTextOrTextSelectionChanged, |
| 40 valueChanged: this.onValueChanged | 41 valueChanged: this.onValueChanged |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 /** @type {boolean} @private */ | 44 /** @type {boolean} @private */ |
| 44 this.isRegistered_ = false; | 45 this.isRegistered_ = false; |
| 45 | 46 |
| 46 /** @type {!Object<string, function(AutomationEvent): void>} @private */ | 47 /** @type {!Object<string, function(AutomationEvent): void>} @private */ |
| 47 this.listeners_ = {}; | 48 this.listeners_ = {}; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 118 |
| 118 /** | 119 /** |
| 119 * @param {Object} evt | 120 * @param {Object} evt |
| 120 */ | 121 */ |
| 121 onFocus: function(evt) {}, | 122 onFocus: function(evt) {}, |
| 122 | 123 |
| 123 /** | 124 /** |
| 124 * @param {Object} evt | 125 * @param {Object} evt |
| 125 */ | 126 */ |
| 126 onLoadComplete: function(evt) {}, | 127 onLoadComplete: function(evt) {}, |
| 128 |
| 129 /** |
| 130 * @param {Object} evt |
| 131 */ |
| 127 onEventDefault: function(evt) {}, | 132 onEventDefault: function(evt) {}, |
| 128 | 133 |
| 129 /** | 134 /** |
| 130 * @param {Object} evt | 135 * @param {Object} evt |
| 131 */ | 136 */ |
| 137 onScrollPositionChanged: function(evt) {}, |
| 138 |
| 139 /** |
| 140 * @param {Object} evt |
| 141 */ |
| 132 onTextOrTextSelectionChanged: function(evt) {}, | 142 onTextOrTextSelectionChanged: function(evt) {}, |
| 133 | 143 |
| 134 /** | 144 /** |
| 135 * @param {Object} evt | 145 * @param {Object} evt |
| 136 */ | 146 */ |
| 137 onValueChanged: function(evt) {} | 147 onValueChanged: function(evt) {} |
| 138 }; | 148 }; |
| 139 | 149 |
| 140 }); // goog.scope | 150 }); // goog.scope |
| OLD | NEW |