Switch TestFrameNavigationObserver to DidCommitProvisionalLoadForFrame.
[chromium-blink-merge.git] / third_party / google_input_tools / src / chrome / os / inputview / events.js
blob14bd370c6ce155ea693397e9672c8812c29e10b1
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
14 goog.provide('i18n.input.chrome.inputview.events.ConfigLoadedEvent');
15 goog.provide('i18n.input.chrome.inputview.events.ContextUpdateEvent');
16 goog.provide('i18n.input.chrome.inputview.events.DragEvent');
17 goog.provide('i18n.input.chrome.inputview.events.EventType');
18 goog.provide('i18n.input.chrome.inputview.events.LayoutLoadedEvent');
19 goog.provide('i18n.input.chrome.inputview.events.PointerEvent');
20 goog.provide('i18n.input.chrome.inputview.events.SurroundingTextChangedEvent');
21 goog.provide('i18n.input.chrome.inputview.events.SwipeEvent');
23 goog.require('goog.events');
24 goog.require('goog.events.Event');
27 goog.scope(function() {
28 var events = i18n.input.chrome.inputview.events;
31 /**
32 * Event types in input view keyboard.
34 * @enum {string}
36 events.EventType = {
37 CLICK: goog.events.getUniqueId('c'),
38 CONFIG_LOADED: goog.events.getUniqueId('cl'),
39 DOUBLE_CLICK: goog.events.getUniqueId('dc'),
40 DOUBLE_CLICK_END: goog.events.getUniqueId('dce'),
41 DRAG: goog.events.getUniqueId('dg'),
42 LAYOUT_LOADED: goog.events.getUniqueId('ll'),
43 LONG_PRESS: goog.events.getUniqueId('lp'),
44 LONG_PRESS_END: goog.events.getUniqueId('lpe'),
45 POINTER_DOWN: goog.events.getUniqueId('pd'),
46 POINTER_UP: goog.events.getUniqueId('pu'),
47 POINTER_OVER: goog.events.getUniqueId('pv'),
48 POINTER_OUT: goog.events.getUniqueId('po'),
49 REFRESH: goog.events.getUniqueId('rf'),
50 SETTINGS_READY: goog.events.getUniqueId('sr'),
51 SURROUNDING_TEXT_CHANGED: goog.events.getUniqueId('stc'),
52 SWIPE: goog.events.getUniqueId('s'),
53 CONTEXT_UPDATE: goog.events.getUniqueId('cu'),
54 CONTEXT_FOCUS: goog.events.getUniqueId('cf'),
55 CONTEXT_BLUR: goog.events.getUniqueId('cb'),
56 VISIBILITY_CHANGE: goog.events.getUniqueId('vc'),
57 MODEL_UPDATE: goog.events.getUniqueId('mu'),
58 URL_CHANGED: goog.events.getUniqueId('uc')
63 /**
64 * The event when the data is loaded complete.
66 * @param {!Object} data The layout data.
67 * @constructor
68 * @extends {goog.events.Event}
70 events.LayoutLoadedEvent = function(data) {
71 goog.base(this, events.EventType.LAYOUT_LOADED);
73 /**
74 * The layout data.
76 * @type {!Object}
78 this.data = data;
80 goog.inherits(events.LayoutLoadedEvent, goog.events.Event);
84 /**
85 * The event when the configuration is loaded complete.
87 * @param {!Object} data The configuration data.
88 * @constructor
89 * @extends {goog.events.Event}
91 events.ConfigLoadedEvent = function(data) {
92 goog.base(this, events.EventType.CONFIG_LOADED);
94 /**
95 * The configuration data.
97 * @type {!Object}
99 this.data = data;
101 goog.inherits(events.ConfigLoadedEvent, goog.events.Event);
106 * The pointer event.
108 * @param {i18n.input.chrome.inputview.elements.Element} view .
109 * @param {events.EventType} type .
110 * @param {Node} target The event target.
111 * @param {number} x .
112 * @param {number} y .
113 * @param {number} identifier .
114 * @param {number=} opt_timestamp The timestamp of a pointer event.
115 * @constructor
116 * @extends {goog.events.Event}
118 events.PointerEvent = function(view, type, target, x, y, identifier,
119 opt_timestamp) {
120 goog.base(this, type, target);
123 * The view.
125 * @type {i18n.input.chrome.inputview.elements.Element}
127 this.view = view;
130 * The x-coordinate.
132 * @type {number}
134 this.x = x;
137 * The y-coordinate.
139 * @type {number}
141 this.y = y;
144 * The event identifier.
146 * @type {number}
148 this.identifier = identifier;
151 * The timestamp.
153 * @type {number}
155 this.timestamp = opt_timestamp || 0;
157 goog.inherits(events.PointerEvent, goog.events.Event);
162 * The swipe event.
164 * @param {i18n.input.chrome.inputview.elements.Element} view .
165 * @param {number} direction See SwipeDirection in pointer handler.
166 * @param {Node} target The event target.
167 * @param {number} x .
168 * @param {number} y .
169 * @param {number} identifier .
170 * @constructor
171 * @extends {events.PointerEvent}
173 events.SwipeEvent = function(view, direction, target, x, y, identifier) {
174 goog.base(this, view, events.EventType.SWIPE,
175 target, x, y, identifier);
178 * The direction.
180 * @type {number}
182 this.direction = direction;
184 goog.inherits(events.SwipeEvent, events.PointerEvent);
189 * The drag event.
191 * @param {i18n.input.chrome.inputview.elements.Element} view .
192 * @param {number} direction See SwipeDirection in pointer handler.
193 * @param {Node} target The event target.
194 * @param {number} x .
195 * @param {number} y .
196 * @param {number} deltaX The drag distance of x-coordinate.
197 * @param {number} deltaY The drag distance of y-coordinate.
198 * @param {number} identifier .
199 * @constructor
200 * @extends {events.PointerEvent}
202 events.DragEvent = function(view, direction, target, x, y, deltaX, deltaY,
203 identifier) {
204 goog.base(this, view, events.EventType.DRAG,
205 target, x, y, identifier);
207 * The direction
209 * @type {number}
211 this.direction = direction;
214 * The value of deltaX
216 * @type {number}
218 this.deltaX = deltaX;
221 * The value of deltaY
223 * @type {number}
225 this.deltaY = deltaY;
227 goog.inherits(events.DragEvent, events.PointerEvent);
232 * The event when the surrounding text is changed.
234 * @param {string} text The surrounding text.
235 * @param {number} anchor .
236 * @param {number} focus .
237 * @constructor
238 * @extends {goog.events.Event}
240 events.SurroundingTextChangedEvent = function(text, anchor, focus) {
241 goog.base(this, events.EventType.SURROUNDING_TEXT_CHANGED);
243 /** @type {string} */
244 this.text = text;
245 /** @type {number} */
246 this.anchor = anchor;
247 /** @type {number} */
248 this.focus = focus;
250 goog.inherits(events.SurroundingTextChangedEvent, goog.events.Event);
255 * The event when context is updated.
257 * @param {string} compositionText .
258 * @param {string} committedText .
259 * @constructor
260 * @extends {goog.events.Event}
262 events.ContextUpdateEvent = function(compositionText, committedText) {
263 goog.base(this, events.EventType.CONTEXT_UPDATE);
265 /** @type {string} */
266 this.compositionText = compositionText;
268 /** @type {string} */
269 this.committedText = committedText;
271 goog.inherits(events.ContextUpdateEvent, goog.events.Event);
273 }); // goog.scope