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

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

Issue 2984843003: MD Settings: Convert all usages of .bind(this) to use ES6 arrow function. (Closed)
Patch Set: Resolve conflicts. Created 3 years, 5 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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 */ 43 */
44 updateDevicesMenu_: function(type, devices, defaultDevice) { 44 updateDevicesMenu_: function(type, devices, defaultDevice) {
45 if (type != this.type) 45 if (type != this.type)
46 return; 46 return;
47 47
48 this.$.picker.hidden = devices.length == 0; 48 this.$.picker.hidden = devices.length == 0;
49 if (devices.length > 0) { 49 if (devices.length > 0) {
50 this.devices = devices; 50 this.devices = devices;
51 51
52 // Wait for <select> to be populated. 52 // Wait for <select> to be populated.
53 this.async(function() { 53 this.async(() => {
54 this.$.mediaPicker.value = defaultDevice; 54 this.$.mediaPicker.value = defaultDevice;
55 }.bind(this)); 55 });
56 } 56 }
57 }, 57 },
58 58
59 /** 59 /**
60 * 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.
61 * @private 61 * @private
62 */ 62 */
63 onChange_: function() { 63 onChange_: function() {
64 this.browserProxy.setDefaultCaptureDevice( 64 this.browserProxy.setDefaultCaptureDevice(
65 this.type, this.$.mediaPicker.value); 65 this.type, this.$.mediaPicker.value);
66 }, 66 },
67 }); 67 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698