OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 * @typedef {{accessibility: Function, | 6 * @typedef {{accessibility: Function, |
7 * documentLoadComplete: Function, | 7 * documentLoadComplete: Function, |
8 * getHeight: Function, | 8 * getHeight: Function, |
9 * getHorizontalScrollbarThickness: Function, | 9 * getHorizontalScrollbarThickness: Function, |
10 * getPageLocationNormalized: Function, | 10 * getPageLocationNormalized: Function, |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 // No scroll bar anywhere, or the active element is something else, like a | 287 // No scroll bar anywhere, or the active element is something else, like a |
288 // button. Note: buttons have a bigger scrollHeight than clientHeight. | 288 // button. Note: buttons have a bigger scrollHeight than clientHeight. |
289 this.plugin_.sendKeyEvent(e); | 289 this.plugin_.sendKeyEvent(e); |
290 e.preventDefault(); | 290 e.preventDefault(); |
291 }, | 291 }, |
292 | 292 |
293 /** | 293 /** |
294 * Set a callback that gets called when a key event is received that | 294 * Set a callback that gets called when a key event is received that |
295 * originates in the plugin. | 295 * originates in the plugin. |
296 * @param {function(Event)} callback The callback to be called with a key | 296 * @param {function(KeyboardEvent)} callback The callback to be called with |
297 * event. | 297 * a key event. |
298 */ | 298 */ |
299 setPluginKeyEventCallback: function(callback) { | 299 setPluginKeyEventCallback: function(callback) { |
300 this.keyEventCallback_ = callback; | 300 this.keyEventCallback_ = callback; |
301 }, | 301 }, |
302 | 302 |
303 /** | 303 /** |
304 * Shows a custom message on the preview area's overlay. | 304 * Shows a custom message on the preview area's overlay. |
305 * @param {string} message Custom message to show. | 305 * @param {string} message Custom message to show. |
306 */ | 306 */ |
307 showCustomMessage: function(message) { | 307 showCustomMessage: function(message) { |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 // being draggable. | 658 // being draggable. |
659 this.plugin_.style.pointerEvents = isDragging ? 'none' : 'auto'; | 659 this.plugin_.style.pointerEvents = isDragging ? 'none' : 'auto'; |
660 } | 660 } |
661 }; | 661 }; |
662 | 662 |
663 // Export | 663 // Export |
664 return { | 664 return { |
665 PreviewArea: PreviewArea | 665 PreviewArea: PreviewArea |
666 }; | 666 }; |
667 }); | 667 }); |
OLD | NEW |