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

Side by Side Diff: chromeos/audio/cras_audio_handler.cc

Issue 385073009: Side Slide Gestures for Accessibility (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Memory leak Created 6 years, 5 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 | « chromeos/audio/cras_audio_handler.h ('k') | ui/chromeos/touch_exploration_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/audio/cras_audio_handler.h" 5 #include "chromeos/audio/cras_audio_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 109 }
110 110
111 bool CrasAudioHandler::IsOutputMutedForDevice(uint64 device_id) { 111 bool CrasAudioHandler::IsOutputMutedForDevice(uint64 device_id) {
112 const AudioDevice* device = GetDeviceFromId(device_id); 112 const AudioDevice* device = GetDeviceFromId(device_id);
113 if (!device) 113 if (!device)
114 return false; 114 return false;
115 DCHECK(!device->is_input); 115 DCHECK(!device->is_input);
116 return audio_pref_handler_->GetMuteValue(*device); 116 return audio_pref_handler_->GetMuteValue(*device);
117 } 117 }
118 118
119 bool CrasAudioHandler::IsOutputVolumeBelowDefaultMuteLvel() { 119 bool CrasAudioHandler::IsOutputVolumeBelowDefaultMuteLevel() {
120 return output_volume_ <= kMuteThresholdPercent; 120 return output_volume_ <= kMuteThresholdPercent;
121 } 121 }
122 122
123 bool CrasAudioHandler::IsInputMuted() { 123 bool CrasAudioHandler::IsInputMuted() {
124 return input_mute_on_; 124 return input_mute_on_;
125 } 125 }
126 126
127 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) { 127 bool CrasAudioHandler::IsInputMutedForDevice(uint64 device_id) {
128 const AudioDevice* device = GetDeviceFromId(device_id); 128 const AudioDevice* device = GetDeviceFromId(device_id);
129 if (!device) 129 if (!device)
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 UpdateDevicesAndSwitchActive(node_list); 704 UpdateDevicesAndSwitchActive(node_list);
705 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged()); 705 FOR_EACH_OBSERVER(AudioObserver, observers_, OnAudioNodesChanged());
706 } 706 }
707 707
708 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name, 708 void CrasAudioHandler::HandleGetNodesError(const std::string& error_name,
709 const std::string& error_msg) { 709 const std::string& error_msg) {
710 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: " 710 LOG_IF(ERROR, log_errors_) << "Failed to call GetNodes: "
711 << error_name << ": " << error_msg; 711 << error_name << ": " << error_msg;
712 } 712 }
713 } // namespace chromeos 713 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/audio/cras_audio_handler.h ('k') | ui/chromeos/touch_exploration_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698