| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ash/system/chromeos/audio/audio_detailed_view.h" | 5 #include "ash/system/chromeos/audio/audio_detailed_view.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/fixed_sized_scroll_view.h" | 7 #include "ash/system/tray/fixed_sized_scroll_view.h" |
| 8 #include "ash/system/tray/hover_highlight_view.h" | 8 #include "ash/system/tray/hover_highlight_view.h" |
| 9 #include "ash/system/tray/tray_constants.h" | 9 #include "ash/system/tray/tray_constants.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 CreateHeaderEntry(); | 113 CreateHeaderEntry(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void AudioDetailedView::UpdateAudioDevices() { | 116 void AudioDetailedView::UpdateAudioDevices() { |
| 117 output_devices_.clear(); | 117 output_devices_.clear(); |
| 118 input_devices_.clear(); | 118 input_devices_.clear(); |
| 119 chromeos::AudioDeviceList devices; | 119 chromeos::AudioDeviceList devices; |
| 120 CrasAudioHandler::Get()->GetAudioDevices(&devices); | 120 CrasAudioHandler::Get()->GetAudioDevices(&devices); |
| 121 for (size_t i = 0; i < devices.size(); ++i) { | 121 for (size_t i = 0; i < devices.size(); ++i) { |
| 122 // Don't display keyboard mic or aokr type. | 122 // Don't display keyboard mic or aokr type. |
| 123 if (!devices[i].is_for_simple_usage()) | 123 if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC || |
| 124 devices[i].type == chromeos::AUDIO_TYPE_AOKR || |
| 125 devices[i].type == chromeos::AUDIO_TYPE_POST_MIX_LOOPBACK || |
| 126 devices[i].type == chromeos::AUDIO_TYPE_POST_DSP_LOOPBACK) |
| 124 continue; | 127 continue; |
| 125 if (devices[i].is_input) | 128 if (devices[i].is_input) |
| 126 input_devices_.push_back(devices[i]); | 129 input_devices_.push_back(devices[i]); |
| 127 else | 130 else |
| 128 output_devices_.push_back(devices[i]); | 131 output_devices_.push_back(devices[i]); |
| 129 } | 132 } |
| 130 UpdateScrollableList(); | 133 UpdateScrollableList(); |
| 131 } | 134 } |
| 132 | 135 |
| 133 void AudioDetailedView::UpdateScrollableList() { | 136 void AudioDetailedView::UpdateScrollableList() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 AudioDeviceMap::iterator iter = device_map_.find(sender); | 170 AudioDeviceMap::iterator iter = device_map_.find(sender); |
| 168 if (iter == device_map_.end()) | 171 if (iter == device_map_.end()) |
| 169 return; | 172 return; |
| 170 chromeos::AudioDevice& device = iter->second; | 173 chromeos::AudioDevice& device = iter->second; |
| 171 CrasAudioHandler::Get()->SwitchToDevice(device, true); | 174 CrasAudioHandler::Get()->SwitchToDevice(device, true); |
| 172 } | 175 } |
| 173 } | 176 } |
| 174 | 177 |
| 175 } // namespace tray | 178 } // namespace tray |
| 176 } // namespace ash | 179 } // namespace ash |
| OLD | NEW |