| 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/tray_audio_delegate_chromeos.h" | 5 #include "ash/system/chromeos/audio/tray_audio_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include "chromeos/audio/cras_audio_handler.h" | 7 #include "chromeos/audio/cras_audio_handler.h" |
| 8 #include "grit/ash_resources.h" | 8 #include "grit/ash_resources.h" |
| 9 | 9 |
| 10 using chromeos::CrasAudioHandler; | 10 using chromeos::CrasAudioHandler; |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 namespace system { | 13 namespace system { |
| 14 | 14 |
| 15 void TrayAudioDelegateChromeOs::AdjustOutputVolumeToAudibleLevel() { | 15 void TrayAudioDelegateChromeOs::AdjustOutputVolumeToAudibleLevel() { |
| 16 CrasAudioHandler::Get()->AdjustOutputVolumeToAudibleLevel(); | 16 CrasAudioHandler::Get()->AdjustOutputVolumeToAudibleLevel(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 int TrayAudioDelegateChromeOs::GetOutputDefaultVolumeMuteLevel() { | 19 int TrayAudioDelegateChromeOs::GetOutputDefaultVolumeMuteLevel() { |
| 20 return CrasAudioHandler::Get()->GetOutputDefaultVolumeMuteThreshold(); | 20 return CrasAudioHandler::Get()->GetOutputDefaultVolumeMuteThreshold(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 int TrayAudioDelegateChromeOs::GetOutputVolumeLevel() { | 23 int TrayAudioDelegateChromeOs::GetOutputVolumeLevel() { |
| 24 return CrasAudioHandler::Get()->GetOutputVolumePercent(); | 24 return CrasAudioHandler::Get()->GetOutputVolumePercent(); |
| 25 } | 25 } |
| 26 | 26 |
| 27 int TrayAudioDelegateChromeOs::GetActiveOutputDeviceIconId() { | 27 int TrayAudioDelegateChromeOs::GetActiveOutputDeviceIconId() { |
| 28 chromeos::AudioDevice device; | 28 chromeos::AudioDevice device; |
| 29 if (!CrasAudioHandler::Get()->GetActiveOutputDevice(&device)) | 29 if (!CrasAudioHandler::Get()->GetPrimaryActiveOutputDevice(&device)) |
| 30 return kNoAudioDeviceIcon; | 30 return kNoAudioDeviceIcon; |
| 31 | 31 |
| 32 if (device.type == chromeos::AUDIO_TYPE_HEADPHONE) | 32 if (device.type == chromeos::AUDIO_TYPE_HEADPHONE) |
| 33 return IDR_AURA_UBER_TRAY_AUDIO_HEADPHONE; | 33 return IDR_AURA_UBER_TRAY_AUDIO_HEADPHONE; |
| 34 else if (device.type == chromeos::AUDIO_TYPE_USB) | 34 else if (device.type == chromeos::AUDIO_TYPE_USB) |
| 35 return IDR_AURA_UBER_TRAY_AUDIO_USB; | 35 return IDR_AURA_UBER_TRAY_AUDIO_USB; |
| 36 else if (device.type == chromeos::AUDIO_TYPE_BLUETOOTH) | 36 else if (device.type == chromeos::AUDIO_TYPE_BLUETOOTH) |
| 37 return IDR_AURA_UBER_TRAY_AUDIO_BLUETOOTH; | 37 return IDR_AURA_UBER_TRAY_AUDIO_BLUETOOTH; |
| 38 else if (device.type == chromeos::AUDIO_TYPE_HDMI) | 38 else if (device.type == chromeos::AUDIO_TYPE_HDMI) |
| 39 return IDR_AURA_UBER_TRAY_AUDIO_HDMI; | 39 return IDR_AURA_UBER_TRAY_AUDIO_HDMI; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 55 void TrayAudioDelegateChromeOs::SetOutputAudioIsMuted(bool is_muted) { | 55 void TrayAudioDelegateChromeOs::SetOutputAudioIsMuted(bool is_muted) { |
| 56 CrasAudioHandler::Get()->SetOutputMute(is_muted); | 56 CrasAudioHandler::Get()->SetOutputMute(is_muted); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void TrayAudioDelegateChromeOs::SetOutputVolumeLevel(int level) { | 59 void TrayAudioDelegateChromeOs::SetOutputVolumeLevel(int level) { |
| 60 CrasAudioHandler::Get()->SetOutputVolumePercent(level); | 60 CrasAudioHandler::Get()->SetOutputVolumePercent(level); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace system | 63 } // namespace system |
| 64 } // namespace ash | 64 } // namespace ash |
| OLD | NEW |