| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 CreateScrollableList(); | 111 CreateScrollableList(); |
| 112 CreateHeaderEntry(); | 112 CreateHeaderEntry(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 void AudioDetailedView::UpdateAudioDevices() { | 115 void AudioDetailedView::UpdateAudioDevices() { |
| 116 output_devices_.clear(); | 116 output_devices_.clear(); |
| 117 input_devices_.clear(); | 117 input_devices_.clear(); |
| 118 chromeos::AudioDeviceList devices; | 118 chromeos::AudioDeviceList devices; |
| 119 CrasAudioHandler::Get()->GetAudioDevices(&devices); | 119 CrasAudioHandler::Get()->GetAudioDevices(&devices); |
| 120 for (size_t i = 0; i < devices.size(); ++i) { | 120 for (size_t i = 0; i < devices.size(); ++i) { |
| 121 // Don't display keyboard mic. | 121 // Don't display keyboard mic or aokr type. |
| 122 if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC) | 122 if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC || |
| 123 devices[i].type == chromeos::AUDIO_TYPE_AOKR) |
| 123 continue; | 124 continue; |
| 124 if (devices[i].is_input) | 125 if (devices[i].is_input) |
| 125 input_devices_.push_back(devices[i]); | 126 input_devices_.push_back(devices[i]); |
| 126 else | 127 else |
| 127 output_devices_.push_back(devices[i]); | 128 output_devices_.push_back(devices[i]); |
| 128 } | 129 } |
| 129 UpdateScrollableList(); | 130 UpdateScrollableList(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void AudioDetailedView::UpdateScrollableList() { | 133 void AudioDetailedView::UpdateScrollableList() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 AudioDeviceMap::iterator iter = device_map_.find(sender); | 169 AudioDeviceMap::iterator iter = device_map_.find(sender); |
| 169 if (iter == device_map_.end()) | 170 if (iter == device_map_.end()) |
| 170 return; | 171 return; |
| 171 chromeos::AudioDevice& device = iter->second; | 172 chromeos::AudioDevice& device = iter->second; |
| 172 CrasAudioHandler::Get()->SwitchToDevice(device, true); | 173 CrasAudioHandler::Get()->SwitchToDevice(device, true); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace tray | 177 } // namespace tray |
| 177 } // namespace ash | 178 } // namespace ash |
| OLD | NEW |