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

Side by Side Diff: chrome/browser/resources/chromeos/emulator/audio_settings.js

Issue 2006083002: Use fake Input Device Settings with chrome://device-emulator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DevicePageTestsFixes
Patch Set: make dependent on a11y fix Created 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 /** @enum {string} */ var AudioNodeType = { 5 /** @enum {string} */ var AudioNodeType = {
6 HEADPHONE: 'HEADPHONE', 6 HEADPHONE: 'HEADPHONE',
7 MIC: 'MIC', 7 MIC: 'MIC',
8 USB: 'USB', 8 USB: 'USB',
9 BLUETOOTH: 'BLUETOOTH', 9 BLUETOOTH: 'BLUETOOTH',
10 HDMI: 'HDMI', 10 HDMI: 'HDMI',
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 {name: 'Aokr', type: AudioNodeType.AOKR}, 101 {name: 'Aokr', type: AudioNodeType.AOKR},
102 {name: 'Post Mix Loopback', type: AudioNodeType.POST_MIX_LOOPBACK}, 102 {name: 'Post Mix Loopback', type: AudioNodeType.POST_MIX_LOOPBACK},
103 {name: 'Post Dsp Loopback', type: AudioNodeType.POST_DSP_LOOPBACK}, 103 {name: 'Post Dsp Loopback', type: AudioNodeType.POST_DSP_LOOPBACK},
104 {name: 'Other', type: AudioNodeType.OTHER} 104 {name: 'Other', type: AudioNodeType.OTHER}
105 ]; 105 ];
106 } 106 }
107 }, 107 },
108 }, 108 },
109 109
110 ready: function() { 110 ready: function() {
111 this.title = 'Audio'; 111 chrome.send('requestAudioNodes');
112 },
113
114 initialize: function() {
115 if (!this.initialized) {
116 chrome.send('requestAudioNodes');
117 this.initialized = true;
118 }
119 }, 112 },
120 113
121 /** 114 /**
122 * Adds a new node with default settings to the list of nodes. 115 * Adds a new node with default settings to the list of nodes.
123 */ 116 */
124 appendNewNode: function() { 117 appendNewNode: function() {
125 var newNode = new AudioNode(); 118 var newNode = new AudioNode();
126 newNode.id += this.nodeCount; 119 newNode.id += this.nodeCount;
127 this.nodeCount++; 120 this.nodeCount++;
128 this.push('nodes', newNode); 121 this.push('nodes', newNode);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 /** @type {!Array<!AudioNode>} */ var newNodeList = []; 193 /** @type {!Array<!AudioNode>} */ var newNodeList = [];
201 for (var i = 0; i < nodeList.length; ++i) { 194 for (var i = 0; i < nodeList.length; ++i) {
202 // Create a new audio node and add all the properties from |nodeList[i]|. 195 // Create a new audio node and add all the properties from |nodeList[i]|.
203 var node = new AudioNode(); 196 var node = new AudioNode();
204 Object.assign(node, nodeList[i]); 197 Object.assign(node, nodeList[i]);
205 newNodeList.push(node); 198 newNodeList.push(node);
206 } 199 }
207 this.nodes = newNodeList; 200 this.nodes = newNodeList;
208 } 201 }
209 }); 202 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698