| Index: ash/system/audio/tray_audio.cc
|
| diff --git a/ash/system/audio/tray_audio.cc b/ash/system/audio/tray_audio.cc
|
| index 7260fc01fe82e371a1093413c1b8b1e54fdbb19c..13269bc228a48a9766396fb7a3631cf950511a88 100644
|
| --- a/ash/system/audio/tray_audio.cc
|
| +++ b/ash/system/audio/tray_audio.cc
|
| @@ -138,6 +138,21 @@ void TrayAudio::OnActiveInputNodeChanged() {
|
| Update();
|
| }
|
|
|
| +void TrayAudio::ChangeInternalSpeakerChannelMode() {
|
| + // Swap left/right channel only if it is in Yoga mode.
|
| + system::TrayAudioDelegate::AudioChannelMode channel_mode =
|
| + system::TrayAudioDelegate::NORMAL;
|
| + if (gfx::Display::InternalDisplayId() != gfx::Display::kInvalidDisplayID) {
|
| + const DisplayInfo& display_info =
|
| + Shell::GetInstance()->display_manager()->GetDisplayInfo(
|
| + gfx::Display::InternalDisplayId());
|
| + if (display_info.GetActiveRotation() == gfx::Display::ROTATE_180)
|
| + channel_mode = system::TrayAudioDelegate::LEFT_RIGHT_SWAPPED;
|
| + }
|
| +
|
| + audio_delegate_->SetInternalSpeakerChannelMode(channel_mode);
|
| +}
|
| +
|
| void TrayAudio::OnDisplayAdded(const gfx::Display& new_display) {
|
| if (new_display.id() != gfx::Display::InternalDisplayId())
|
| return;
|
| @@ -159,21 +174,6 @@ void TrayAudio::OnDisplayMetricsChanged(const gfx::Display& display,
|
| ChangeInternalSpeakerChannelMode();
|
| }
|
|
|
| -void TrayAudio::ChangeInternalSpeakerChannelMode() {
|
| - // Swap left/right channel only if it is in Yoga mode.
|
| - system::TrayAudioDelegate::AudioChannelMode channel_mode =
|
| - system::TrayAudioDelegate::NORMAL;
|
| - if (gfx::Display::InternalDisplayId() != gfx::Display::kInvalidDisplayID) {
|
| - const DisplayInfo& display_info =
|
| - Shell::GetInstance()->display_manager()->GetDisplayInfo(
|
| - gfx::Display::InternalDisplayId());
|
| - if (display_info.GetActiveRotation() == gfx::Display::ROTATE_180)
|
| - channel_mode = system::TrayAudioDelegate::LEFT_RIGHT_SWAPPED;
|
| - }
|
| -
|
| - audio_delegate_->SetInternalSpeakerChannelMode(channel_mode);
|
| -}
|
| -
|
| void TrayAudio::Update() {
|
| if (tray_view())
|
| tray_view()->SetVisible(GetInitialVisibility());
|
|
|