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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'media-picker' handles showing the dropdown allowing users to select the | 7 * 'media-picker' handles showing the dropdown allowing users to select the |
8 * default camera/microphone. | 8 * default camera/microphone. |
9 */ | 9 */ |
10 Polymer({ | 10 Polymer({ |
(...skipping 10 matching lines...) Expand all Loading... |
21 /** Label for a11y purposes. */ | 21 /** Label for a11y purposes. */ |
22 label: String, | 22 label: String, |
23 | 23 |
24 /** | 24 /** |
25 * The devices available to pick from. | 25 * The devices available to pick from. |
26 * @type {Array<MediaPickerEntry>} | 26 * @type {Array<MediaPickerEntry>} |
27 */ | 27 */ |
28 devices: Array, | 28 devices: Array, |
29 }, | 29 }, |
30 | 30 |
| 31 /** @override */ |
31 ready: function() { | 32 ready: function() { |
32 this.addWebUIListener('updateDevicesMenu', | 33 this.addWebUIListener('updateDevicesMenu', |
33 this.updateDevicesMenu_.bind(this)); | 34 this.updateDevicesMenu_.bind(this)); |
34 this.browserProxy.getDefaultCaptureDevices(this.type); | 35 this.browserProxy.getDefaultCaptureDevices(this.type); |
35 }, | 36 }, |
36 | 37 |
37 /** | 38 /** |
38 * Updates the microphone/camera devices menu with the given entries. | 39 * Updates the microphone/camera devices menu with the given entries. |
39 * @param {string} type The device type. | 40 * @param {string} type The device type. |
40 * @param {!Array<MediaPickerEntry>} devices List of available devices. | 41 * @param {!Array<MediaPickerEntry>} devices List of available devices. |
(...skipping 16 matching lines...) Expand all Loading... |
57 | 58 |
58 /** | 59 /** |
59 * A handler for when an item is selected in the media picker. | 60 * A handler for when an item is selected in the media picker. |
60 * @private | 61 * @private |
61 */ | 62 */ |
62 onChange_: function() { | 63 onChange_: function() { |
63 this.browserProxy.setDefaultCaptureDevice( | 64 this.browserProxy.setDefaultCaptureDevice( |
64 this.type, this.$.mediaPicker.value); | 65 this.type, this.$.mediaPicker.value); |
65 }, | 66 }, |
66 }); | 67 }); |
OLD | NEW |