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.exportPath('settings'); | 6 cr.exportPath('settings'); |
7 | 7 |
8 /** | 8 /** |
9 * Mirrors DeviceType from ash/common/system/chromeos/power/power_status.h. | 9 * Mirrors DeviceType from ash/common/system/chromeos/power/power_status.h. |
10 * @enum {number} | 10 * @enum {number} |
(...skipping 23 matching lines...) Expand all Loading... |
34 settings.BatteryStatus; | 34 settings.BatteryStatus; |
35 | 35 |
36 cr.define('settings', function() { | 36 cr.define('settings', function() { |
37 /** @interface */ | 37 /** @interface */ |
38 function DevicePageBrowserProxy() {} | 38 function DevicePageBrowserProxy() {} |
39 | 39 |
40 DevicePageBrowserProxy.prototype = { | 40 DevicePageBrowserProxy.prototype = { |
41 /** Initializes the mouse and touchpad handler. */ | 41 /** Initializes the mouse and touchpad handler. */ |
42 initializePointers: function() {}, | 42 initializePointers: function() {}, |
43 | 43 |
| 44 /** Initializes the stylus handler. */ |
| 45 initializeStylus: function() {}, |
| 46 |
44 /** | 47 /** |
45 * Override to interact with the on-tap/on-keydown event on the Learn More | 48 * Override to interact with the on-tap/on-keydown event on the Learn More |
46 * link. | 49 * link. |
47 * @param {!Event} e | 50 * @param {!Event} e |
48 */ | 51 */ |
49 handleLinkEvent: function(e) {}, | 52 handleLinkEvent: function(e) {}, |
50 | 53 |
51 /** Initializes the keyboard WebUI handler. */ | 54 /** Initializes the keyboard WebUI handler. */ |
52 initializeKeyboard: function() {}, | 55 initializeKeyboard: function() {}, |
53 | 56 |
(...skipping 17 matching lines...) Expand all Loading... |
71 */ | 74 */ |
72 function DevicePageBrowserProxyImpl() {} | 75 function DevicePageBrowserProxyImpl() {} |
73 cr.addSingletonGetter(DevicePageBrowserProxyImpl); | 76 cr.addSingletonGetter(DevicePageBrowserProxyImpl); |
74 | 77 |
75 DevicePageBrowserProxyImpl.prototype = { | 78 DevicePageBrowserProxyImpl.prototype = { |
76 /** @override */ | 79 /** @override */ |
77 initializePointers: function() { | 80 initializePointers: function() { |
78 chrome.send('initializePointerSettings'); | 81 chrome.send('initializePointerSettings'); |
79 }, | 82 }, |
80 | 83 |
| 84 /** @override */ |
| 85 initializeStylus: function() { |
| 86 chrome.send('initializeStylusSettings'); |
| 87 }, |
| 88 |
81 /** override */ | 89 /** override */ |
82 handleLinkEvent: function(e) { | 90 handleLinkEvent: function(e) { |
83 // Prevent the link from activating its parent element when tapped or | 91 // Prevent the link from activating its parent element when tapped or |
84 // when Enter is pressed. | 92 // when Enter is pressed. |
85 if (e.type != 'keydown' || e.keyCode == 13) | 93 if (e.type != 'keydown' || e.keyCode == 13) |
86 e.stopPropagation(); | 94 e.stopPropagation(); |
87 }, | 95 }, |
88 | 96 |
89 /** @override */ | 97 /** @override */ |
90 initializeKeyboard: function() { | 98 initializeKeyboard: function() { |
(...skipping 14 matching lines...) Expand all Loading... |
105 setPowerSource: function(powerSourceId) { | 113 setPowerSource: function(powerSourceId) { |
106 chrome.send('setPowerSource', [powerSourceId]); | 114 chrome.send('setPowerSource', [powerSourceId]); |
107 }, | 115 }, |
108 }; | 116 }; |
109 | 117 |
110 return { | 118 return { |
111 DevicePageBrowserProxy: DevicePageBrowserProxy, | 119 DevicePageBrowserProxy: DevicePageBrowserProxy, |
112 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, | 120 DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, |
113 }; | 121 }; |
114 }); | 122 }); |
OLD | NEW |