summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-20 21:57:38 +0000
committerrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-20 21:57:38 +0000
commit6fda9fb81a18dea0a377322487ec5c39f84222e6 (patch)
tree29600434d19d82281c1f416c3e1563f53794a4d9 /ash
parent21bf9192f2123297edebcbc13183cebc96d3f8d0 (diff)
downloadchromium_src-6fda9fb81a18dea0a377322487ec5c39f84222e6.zip
chromium_src-6fda9fb81a18dea0a377322487ec5c39f84222e6.tar.gz
chromium_src-6fda9fb81a18dea0a377322487ec5c39f84222e6.tar.bz2
Use device_name + node_id to index devices in preferences.
Refactor the code to send the device object itself to the audio devices preferences handler. The preferences handler then pulls the device name and the node_id out of the object to generate it's device identification string. The 'id' field in the AudioDevice object is really the device_id << 32 | node_id (it is sent as one value from cras), so to get the node_id, we need to & the value out. This changes how we store our audio device list internally, using a map instead of a list, making our active node lookups more efficient too. Reviews requested, hshi@ overall review stevenjb@ chromeos/* and ash/system/chromeos/* OWNERs review dgreid@ fyi R=dgreid@chromium.org,hshi@chromium.org,stevenjb@chromium.org BUG=241441 TEST=Tested with switching between various devices to ensure that preferences were remembered and switched per device correctly. Review URL: https://chromiumcodereview.appspot.com/17349003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207595 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/system/chromeos/audio/tray_audio.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/ash/system/chromeos/audio/tray_audio.cc b/ash/system/chromeos/audio/tray_audio.cc
index 742a6e5..0d3cfdf 100644
--- a/ash/system/chromeos/audio/tray_audio.cc
+++ b/ash/system/chromeos/audio/tray_audio.cc
@@ -444,7 +444,7 @@ class AudioDetailedView : public TrayDetailsView,
false); /* no checkmark */
for (size_t i = 0; i < output_devices_.size(); ++i) {
HoverHighlightView* container = AddScrollListItem(
- output_devices_[i].display_name,
+ UTF8ToUTF16(output_devices_[i].display_name),
gfx::Font::NORMAL,
output_devices_[i].active); /* checkmark if active */
device_map_[container] = output_devices_[i];
@@ -459,7 +459,7 @@ class AudioDetailedView : public TrayDetailsView,
false); /* no checkmark */
for (size_t i = 0; i < input_devices_.size(); ++i) {
HoverHighlightView* container = AddScrollListItem(
- input_devices_[i].display_name,
+ UTF8ToUTF16(input_devices_[i].display_name),
gfx::Font::NORMAL,
input_devices_[i].active); /* checkmark if active */
device_map_[container] = input_devices_[i];