summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api
diff options
context:
space:
mode:
authorjennyz <jennyz@chromium.org>2016-01-21 10:22:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-21 18:24:10 +0000
commit2ae95ec857101c352623e6577a1c758bedcbeb66 (patch)
tree0afe7f277a39ccdf9505e36164b3a879d063b392 /extensions/browser/api
parent5183c4281bfd06efe4d6ecc70fd7e86d260916ba (diff)
downloadchromium_src-2ae95ec857101c352623e6577a1c758bedcbeb66.zip
chromium_src-2ae95ec857101c352623e6577a1c758bedcbeb66.tar.gz
chromium_src-2ae95ec857101c352623e6577a1c758bedcbeb66.tar.bz2
Expose stable_device_id in audio extension apis.
BUG=466768 Review URL: https://codereview.chromium.org/1584613003 Cr-Commit-Position: refs/heads/master@{#370730}
Diffstat (limited to 'extensions/browser/api')
-rw-r--r--extensions/browser/api/audio/audio_apitest.cc18
-rw-r--r--extensions/browser/api/audio/audio_service_chromeos.cc4
2 files changed, 14 insertions, 8 deletions
diff --git a/extensions/browser/api/audio/audio_apitest.cc b/extensions/browser/api/audio/audio_apitest.cc
index d53bcd5..6d100059 100644
--- a/extensions/browser/api/audio/audio_apitest.cc
+++ b/extensions/browser/api/audio/audio_apitest.cc
@@ -25,15 +25,21 @@ using chromeos::AudioNode;
using chromeos::AudioNodeList;
const uint64_t kJabraSpeaker1Id = 30001;
+const uint64_t kJabraSpeaker1StableDeviceId = 80001;
const uint64_t kJabraSpeaker2Id = 30002;
+const uint64_t kJabraSpeaker2StableDeviceId = 80002;
const uint64_t kHDMIOutputId = 30003;
+const uint64_t kHDMIOutputStabeDevicelId = 80003;
const uint64_t kJabraMic1Id = 40001;
+const uint64_t kJabraMic1StableDeviceId = 90001;
const uint64_t kJabraMic2Id = 40002;
+const uint64_t kJabraMic2StableDeviceId = 90002;
const uint64_t kWebcamMicId = 40003;
+const uint64_t kWebcamMicStableDeviceId = 90003;
const AudioNode kJabraSpeaker1(false,
kJabraSpeaker1Id,
- kJabraSpeaker1Id,
+ kJabraSpeaker1StableDeviceId,
"Jabra Speaker",
"USB",
"Jabra Speaker 1",
@@ -42,7 +48,7 @@ const AudioNode kJabraSpeaker1(false,
const AudioNode kJabraSpeaker2(false,
kJabraSpeaker2Id,
- kJabraSpeaker2Id,
+ kJabraSpeaker2StableDeviceId,
"Jabra Speaker",
"USB",
"Jabra Speaker 2",
@@ -51,7 +57,7 @@ const AudioNode kJabraSpeaker2(false,
const AudioNode kHDMIOutput(false,
kHDMIOutputId,
- kHDMIOutputId,
+ kHDMIOutputStabeDevicelId,
"HDMI output",
"HDMI",
"HDA Intel MID",
@@ -60,7 +66,7 @@ const AudioNode kHDMIOutput(false,
const AudioNode kJabraMic1(true,
kJabraMic1Id,
- kJabraMic1Id,
+ kJabraMic1StableDeviceId,
"Jabra Mic",
"USB",
"Jabra Mic 1",
@@ -69,7 +75,7 @@ const AudioNode kJabraMic1(true,
const AudioNode kJabraMic2(true,
kJabraMic2Id,
- kJabraMic2Id,
+ kJabraMic2StableDeviceId,
"Jabra Mic",
"USB",
"Jabra Mic 2",
@@ -78,7 +84,7 @@ const AudioNode kJabraMic2(true,
const AudioNode kUSBCameraMic(true,
kWebcamMicId,
- kWebcamMicId,
+ kWebcamMicStableDeviceId,
"Webcam Mic",
"USB",
"Logitech Webcam",
diff --git a/extensions/browser/api/audio/audio_service_chromeos.cc b/extensions/browser/api/audio/audio_service_chromeos.cc
index abd3f85..6089b88 100644
--- a/extensions/browser/api/audio/audio_service_chromeos.cc
+++ b/extensions/browser/api/audio/audio_service_chromeos.cc
@@ -273,8 +273,8 @@ void AudioServiceImpl::NotifyDevicesChanged() {
? cras_audio_handler_->GetOutputVolumePercentForDevice(
devices[i].id)
: cras_audio_handler_->GetInputGainPercentForDevice(devices[i].id);
- // TODO(jennyz): Set stable_device_id once it is implemented.
- // See crbug.com/466768.
+ info->stable_device_id.reset(
+ new std::string(base::Uint64ToString(devices[i].stable_device_id)));
devices_info_list.push_back(info);
}