| 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_chromeos.h" | 5 #include "ash/system/chromeos/audio/tray_audio_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/audio/volume_view.h" | 9 #include "ash/system/audio/volume_view.h" |
| 10 #include "ash/system/chromeos/audio/audio_detailed_view.h" | 10 #include "ash/system/chromeos/audio/audio_detailed_view.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 void TrayAudioChromeOs::DestroyDetailedView() { | 53 void TrayAudioChromeOs::DestroyDetailedView() { |
| 54 if (audio_detail_view_) { | 54 if (audio_detail_view_) { |
| 55 audio_detail_view_ = NULL; | 55 audio_detail_view_ = NULL; |
| 56 } else if (volume_view_) { | 56 } else if (volume_view_) { |
| 57 volume_view_ = NULL; | 57 volume_view_ = NULL; |
| 58 pop_up_volume_view_ = false; | 58 pop_up_volume_view_ = false; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 void TrayAudioChromeOs::OnDisplayAdded(const gfx::Display& new_display) { | 62 void TrayAudioChromeOs::OnDisplayAdded(const display::Display& new_display) { |
| 63 TrayAudio::OnDisplayAdded(new_display); | 63 TrayAudio::OnDisplayAdded(new_display); |
| 64 | 64 |
| 65 // This event will be triggered when the lid of the device is opened to exit | 65 // This event will be triggered when the lid of the device is opened to exit |
| 66 // the docked mode, we should always start or re-start HDMI re-discovering | 66 // the docked mode, we should always start or re-start HDMI re-discovering |
| 67 // grace period right after this event. | 67 // grace period right after this event. |
| 68 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); | 68 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void TrayAudioChromeOs::OnDisplayRemoved(const gfx::Display& old_display) { | 71 void TrayAudioChromeOs::OnDisplayRemoved(const display::Display& old_display) { |
| 72 TrayAudio::OnDisplayRemoved(old_display); | 72 TrayAudio::OnDisplayRemoved(old_display); |
| 73 | 73 |
| 74 // This event will be triggered when the lid of the device is closed to enter | 74 // This event will be triggered when the lid of the device is closed to enter |
| 75 // the docked mode, we should always start or re-start HDMI re-discovering | 75 // the docked mode, we should always start or re-start HDMI re-discovering |
| 76 // grace period right after this event. | 76 // grace period right after this event. |
| 77 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); | 77 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void TrayAudioChromeOs::OnDisplayMetricsChanged(const gfx::Display& display, | 80 void TrayAudioChromeOs::OnDisplayMetricsChanged(const display::Display& display, |
| 81 uint32_t changed_metrics) { | 81 uint32_t changed_metrics) { |
| 82 // The event could be triggered multiple times during the HDMI display | 82 // The event could be triggered multiple times during the HDMI display |
| 83 // transition, we don't need to restart HDMI re-discovering grace period | 83 // transition, we don't need to restart HDMI re-discovering grace period |
| 84 // it is already started earlier. | 84 // it is already started earlier. |
| 85 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(false); | 85 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(false); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void TrayAudioChromeOs::SuspendDone(const base::TimeDelta& sleep_duration) { | 88 void TrayAudioChromeOs::SuspendDone(const base::TimeDelta& sleep_duration) { |
| 89 // This event is triggered when the device resumes after earlier suspension, | 89 // This event is triggered when the device resumes after earlier suspension, |
| 90 // we should always start or re-start HDMI re-discovering | 90 // we should always start or re-start HDMI re-discovering |
| 91 // grace period right after this event. | 91 // grace period right after this event. |
| 92 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); | 92 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); |
| 93 } | 93 } |
| 94 | 94 |
| 95 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |