Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(874)

Side by Side Diff: chrome/browser/resources/settings/site_settings/media_picker.js

Issue 2394963002: MD Settings: Migrate site settings media-picker to native select. (Closed)
Patch Set: Changing parent branch to not have to wait on other CLs. No diff change. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/settings/site_settings/media_picker.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 26 matching lines...) Expand all
37 * @param {!Array<MediaPickerEntry>} devices List of available devices. 37 * @param {!Array<MediaPickerEntry>} devices List of available devices.
38 * @param {string} defaultDevice The unique id of the current default device. 38 * @param {string} defaultDevice The unique id of the current default device.
39 */ 39 */
40 updateDevicesMenu_: function(type, devices, defaultDevice) { 40 updateDevicesMenu_: function(type, devices, defaultDevice) {
41 if (type != this.type) 41 if (type != this.type)
42 return; 42 return;
43 43
44 this.$.picker.hidden = devices.length == 0; 44 this.$.picker.hidden = devices.length == 0;
45 if (devices.length > 0) { 45 if (devices.length > 0) {
46 this.devices = devices; 46 this.devices = devices;
47 this.$.mediaPicker.selected = defaultDevice; 47
48 // Wait for <select> to be populated.
49 this.async(function() {
50 this.$.mediaPicker.value = defaultDevice;
51 }.bind(this));
48 } 52 }
49 }, 53 },
50 54
51 /** 55 /**
52 * A handler for when an item is selected in the media picker. 56 * A handler for when an item is selected in the media picker.
57 * @private
53 */ 58 */
54 onMediaPickerActivate_: function(event) { 59 onChange_: function() {
55 this.browserProxy.setDefaultCaptureDevice(this.type, event.detail.selected); 60 this.browserProxy.setDefaultCaptureDevice(
61 this.type, this.$.mediaPicker.value);
56 }, 62 },
57 }); 63 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/settings/site_settings/media_picker.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698