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

Side by Side Diff: ash/system/chromeos/audio/audio_detailed_view.cc

Issue 1186293003: Implement HasInputDevices in CrasAudioManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | chromeos/DEPS » ('j') | chromeos/audio/audio_device.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 CreateHeaderEntry(); 110 CreateHeaderEntry();
111 } 111 }
112 112
113 void AudioDetailedView::UpdateAudioDevices() { 113 void AudioDetailedView::UpdateAudioDevices() {
114 output_devices_.clear(); 114 output_devices_.clear();
115 input_devices_.clear(); 115 input_devices_.clear();
116 chromeos::AudioDeviceList devices; 116 chromeos::AudioDeviceList devices;
117 CrasAudioHandler::Get()->GetAudioDevices(&devices); 117 CrasAudioHandler::Get()->GetAudioDevices(&devices);
118 for (size_t i = 0; i < devices.size(); ++i) { 118 for (size_t i = 0; i < devices.size(); ++i) {
119 // Don't display keyboard mic or aokr type. 119 // Don't display keyboard mic or aokr type.
120 if (devices[i].type == chromeos::AUDIO_TYPE_KEYBOARD_MIC || 120 if (!devices[i].is_for_simple_usage)
121 devices[i].type == chromeos::AUDIO_TYPE_AOKR ||
122 devices[i].type == chromeos::AUDIO_TYPE_POST_MIX_LOOPBACK ||
123 devices[i].type == chromeos::AUDIO_TYPE_POST_DSP_LOOPBACK)
124 continue; 121 continue;
125 if (devices[i].is_input) 122 if (devices[i].is_input)
126 input_devices_.push_back(devices[i]); 123 input_devices_.push_back(devices[i]);
127 else 124 else
128 output_devices_.push_back(devices[i]); 125 output_devices_.push_back(devices[i]);
129 } 126 }
130 UpdateScrollableList(); 127 UpdateScrollableList();
131 } 128 }
132 129
133 void AudioDetailedView::UpdateScrollableList() { 130 void AudioDetailedView::UpdateScrollableList() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 AudioDeviceMap::iterator iter = device_map_.find(sender); 164 AudioDeviceMap::iterator iter = device_map_.find(sender);
168 if (iter == device_map_.end()) 165 if (iter == device_map_.end())
169 return; 166 return;
170 chromeos::AudioDevice& device = iter->second; 167 chromeos::AudioDevice& device = iter->second;
171 CrasAudioHandler::Get()->SwitchToDevice(device, true); 168 CrasAudioHandler::Get()->SwitchToDevice(device, true);
172 } 169 }
173 } 170 }
174 171
175 } // namespace tray 172 } // namespace tray
176 } // namespace ash 173 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chromeos/DEPS » ('j') | chromeos/audio/audio_device.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698