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

Unified Diff: ash/system/audio/tray_audio.cc

Issue 1199413008: Work around for HDMI audio output rediscovering transistion loss. (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 side-by-side diff with in-line comments
Download patch
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() {
cychiang 2015/06/26 10:00:21 I guess you actually move three OnDisplay methods.
jennyz 2015/06/29 20:49:41 It enables the derived class TrayAudioChromeos to
+ // 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());

Powered by Google App Engine
This is Rietveld 408576698