| 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 /** | 11 /** |
| 12 * Override to interact with the on-tap/on-keydown event on the Learn More | 12 * Override to interact with the on-tap/on-keydown event on the Learn More |
| 13 * link. | 13 * link. |
| 14 * @param {!Event} e | 14 * @param {!Event} e |
| 15 */ | 15 */ |
| 16 handleLinkEvent: function(e) {}, | 16 handleLinkEvent: function(e) {}, |
| 17 |
| 18 /** Initializes the keyboard WebUI handler. */ |
| 19 initializeKeyboard: function() {}, |
| 20 |
| 21 /** Shows the Ash keyboard shortcuts overlay. */ |
| 22 showKeyboardShortcutsOverlay: function() {}, |
| 17 }; | 23 }; |
| 18 | 24 |
| 19 /** | 25 /** |
| 20 * @constructor | 26 * @constructor |
| 21 * @implements {settings.DevicePageBrowserProxy} | 27 * @implements {settings.DevicePageBrowserProxy} |
| 22 */ | 28 */ |
| 23 function DevicePageBrowserProxyImpl() {} | 29 function DevicePageBrowserProxyImpl() {} |
| 24 cr.addSingletonGetter(DevicePageBrowserProxyImpl); | 30 cr.addSingletonGetter(DevicePageBrowserProxyImpl); |
| 25 | 31 |
| 26 DevicePageBrowserProxyImpl.prototype = { | 32 DevicePageBrowserProxyImpl.prototype = { |
| 27 /** override */ | 33 /** override */ |
| 28 handleLinkEvent: function(e) { | 34 handleLinkEvent: function(e) { |
| 29 // Prevent the link from activating its parent element when tapped or | 35 // Prevent the link from activating its parent element when tapped or |
| 30 // when Enter is pressed. | 36 // when Enter is pressed. |
| 31 if (e.type != 'keydown' || e.keyCode == 13) | 37 if (e.type != 'keydown' || e.keyCode == 13) |
| 32 e.stopPropagation(); | 38 e.stopPropagation(); |
| 33 }, | 39 }, |
| 40 |
| 41 /** @override */ |
| 42 initializeKeyboard: function() { |
| 43 chrome.send('initializeKeyboardSettings'); |
| 44 }, |
| 45 |
| 46 /** @override */ |
| 47 showKeyboardShortcutsOverlay: function() { |
| 48 chrome.send('showKeyboardShortcutsOverlay'); |
| 49 }, |
| 34 }; | 50 }; |
| 35 | 51 |
| 36 return { | 52 return { |
| 37 DevicePageBrowserProxy: DevicePageBrowserProxy, | 53 DevicePageBrowserProxy: DevicePageBrowserProxy, |
| 38 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, | 54 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, |
| 39 }; | 55 }; |
| 40 }); | 56 }); |
| OLD | NEW |