| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 /** @fileoverview A helper object used for testing the Device page. */ | 5 /** @fileoverview A helper object used for testing the Device page. */ |
| 6 cr.define('settings', function() { | 6 cr.define('settings', function() { |
| 7 /** @interface */ | 7 /** @interface */ |
| 8 function DevicePageBrowserProxy() {} | 8 function DevicePageBrowserProxy() {} |
| 9 | 9 |
| 10 DevicePageBrowserProxy.prototype = { | 10 DevicePageBrowserProxy.prototype = { |
| 11 /** Initializes the mouse and touchpad handler. */ |
| 12 initializePointers: function() {}, |
| 13 |
| 11 /** | 14 /** |
| 12 * Override to interact with the on-tap/on-keydown event on the Learn More | 15 * Override to interact with the on-tap/on-keydown event on the Learn More |
| 13 * link. | 16 * link. |
| 14 * @param {!Event} e | 17 * @param {!Event} e |
| 15 */ | 18 */ |
| 16 handleLinkEvent: function(e) {}, | 19 handleLinkEvent: function(e) {}, |
| 17 | 20 |
| 18 /** Initializes the keyboard WebUI handler. */ | 21 /** Initializes the keyboard WebUI handler. */ |
| 19 initializeKeyboard: function() {}, | 22 initializeKeyboard: function() {}, |
| 20 | 23 |
| 21 /** Shows the Ash keyboard shortcuts overlay. */ | 24 /** Shows the Ash keyboard shortcuts overlay. */ |
| 22 showKeyboardShortcutsOverlay: function() {}, | 25 showKeyboardShortcutsOverlay: function() {}, |
| 23 }; | 26 }; |
| 24 | 27 |
| 25 /** | 28 /** |
| 26 * @constructor | 29 * @constructor |
| 27 * @implements {settings.DevicePageBrowserProxy} | 30 * @implements {settings.DevicePageBrowserProxy} |
| 28 */ | 31 */ |
| 29 function DevicePageBrowserProxyImpl() {} | 32 function DevicePageBrowserProxyImpl() {} |
| 30 cr.addSingletonGetter(DevicePageBrowserProxyImpl); | 33 cr.addSingletonGetter(DevicePageBrowserProxyImpl); |
| 31 | 34 |
| 32 DevicePageBrowserProxyImpl.prototype = { | 35 DevicePageBrowserProxyImpl.prototype = { |
| 36 /** @override */ |
| 37 initializePointers: function() { |
| 38 chrome.send('initializePointerSettings'); |
| 39 }, |
| 40 |
| 33 /** override */ | 41 /** override */ |
| 34 handleLinkEvent: function(e) { | 42 handleLinkEvent: function(e) { |
| 35 // Prevent the link from activating its parent element when tapped or | 43 // Prevent the link from activating its parent element when tapped or |
| 36 // when Enter is pressed. | 44 // when Enter is pressed. |
| 37 if (e.type != 'keydown' || e.keyCode == 13) | 45 if (e.type != 'keydown' || e.keyCode == 13) |
| 38 e.stopPropagation(); | 46 e.stopPropagation(); |
| 39 }, | 47 }, |
| 40 | 48 |
| 41 /** @override */ | 49 /** @override */ |
| 42 initializeKeyboard: function() { | 50 initializeKeyboard: function() { |
| 43 chrome.send('initializeKeyboardSettings'); | 51 chrome.send('initializeKeyboardSettings'); |
| 44 }, | 52 }, |
| 45 | 53 |
| 46 /** @override */ | 54 /** @override */ |
| 47 showKeyboardShortcutsOverlay: function() { | 55 showKeyboardShortcutsOverlay: function() { |
| 48 chrome.send('showKeyboardShortcutsOverlay'); | 56 chrome.send('showKeyboardShortcutsOverlay'); |
| 49 }, | 57 }, |
| 50 }; | 58 }; |
| 51 | 59 |
| 52 return { | 60 return { |
| 53 DevicePageBrowserProxy: DevicePageBrowserProxy, | 61 DevicePageBrowserProxy: DevicePageBrowserProxy, |
| 54 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, | 62 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, |
| 55 }; | 63 }; |
| 56 }); | 64 }); |
| OLD | NEW |