| 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/common/system/audio/volume_view.h" | 7 #include "ash/common/system/audio/volume_view.h" |
| 8 #include "ash/metrics/user_metrics_recorder.h" | 8 #include "ash/common/wm_shell.h" |
| 9 #include "ash/shell.h" | |
| 10 #include "ash/system/chromeos/audio/audio_detailed_view.h" | 9 #include "ash/system/chromeos/audio/audio_detailed_view.h" |
| 11 #include "ash/system/chromeos/audio/tray_audio_delegate_chromeos.h" | 10 #include "ash/system/chromeos/audio/tray_audio_delegate_chromeos.h" |
| 12 #include "chromeos/dbus/dbus_thread_manager.h" | 11 #include "chromeos/dbus/dbus_thread_manager.h" |
| 13 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 14 | 13 |
| 15 namespace ash { | 14 namespace ash { |
| 16 | 15 |
| 17 using system::TrayAudioDelegate; | 16 using system::TrayAudioDelegate; |
| 18 using system::TrayAudioDelegateChromeOs; | 17 using system::TrayAudioDelegateChromeOs; |
| 19 | 18 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 36 | 35 |
| 37 if (audio_detail_view_) | 36 if (audio_detail_view_) |
| 38 audio_detail_view_->Update(); | 37 audio_detail_view_->Update(); |
| 39 } | 38 } |
| 40 | 39 |
| 41 views::View* TrayAudioChromeOs::CreateDetailedView(LoginStatus status) { | 40 views::View* TrayAudioChromeOs::CreateDetailedView(LoginStatus status) { |
| 42 if (pop_up_volume_view_) { | 41 if (pop_up_volume_view_) { |
| 43 volume_view_ = new tray::VolumeView(this, audio_delegate_.get(), false); | 42 volume_view_ = new tray::VolumeView(this, audio_delegate_.get(), false); |
| 44 return volume_view_; | 43 return volume_view_; |
| 45 } else { | 44 } else { |
| 46 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 45 WmShell::Get()->RecordUserMetricsAction( |
| 47 ash::UMA_STATUS_AREA_DETAILED_AUDIO_VIEW); | 46 UMA_STATUS_AREA_DETAILED_AUDIO_VIEW); |
| 48 audio_detail_view_ = new tray::AudioDetailedView(this); | 47 audio_detail_view_ = new tray::AudioDetailedView(this); |
| 49 return audio_detail_view_; | 48 return audio_detail_view_; |
| 50 } | 49 } |
| 51 } | 50 } |
| 52 | 51 |
| 53 void TrayAudioChromeOs::DestroyDetailedView() { | 52 void TrayAudioChromeOs::DestroyDetailedView() { |
| 54 if (audio_detail_view_) { | 53 if (audio_detail_view_) { |
| 55 audio_detail_view_ = NULL; | 54 audio_detail_view_ = NULL; |
| 56 } else if (volume_view_) { | 55 } else if (volume_view_) { |
| 57 volume_view_ = NULL; | 56 volume_view_ = NULL; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 } | 85 } |
| 87 | 86 |
| 88 void TrayAudioChromeOs::SuspendDone(const base::TimeDelta& sleep_duration) { | 87 void TrayAudioChromeOs::SuspendDone(const base::TimeDelta& sleep_duration) { |
| 89 // This event is triggered when the device resumes after earlier suspension, | 88 // This event is triggered when the device resumes after earlier suspension, |
| 90 // we should always start or re-start HDMI re-discovering | 89 // we should always start or re-start HDMI re-discovering |
| 91 // grace period right after this event. | 90 // grace period right after this event. |
| 92 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); | 91 audio_delegate_->SetActiveHDMIOutoutRediscoveringIfNecessary(true); |
| 93 } | 92 } |
| 94 | 93 |
| 95 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |