| 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/common/system/chromeos/audio/tray_audio.h" | 5 #include "ash/common/system/chromeos/audio/tray_audio.h" |
| 6 | 6 |
| 7 #include "ash/common/system/chromeos/audio/audio_detailed_view.h" | 7 #include "ash/common/system/chromeos/audio/audio_detailed_view.h" |
| 8 #include "ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h" | 8 #include "ash/common/system/chromeos/audio/tray_audio_delegate_chromeos.h" |
| 9 #include "ash/common/system/chromeos/audio/volume_view.h" | 9 #include "ash/common/system/chromeos/audio/volume_view.h" |
| 10 #include "ash/common/system/tray/system_tray_notifier.h" | 10 #include "ash/common/system/tray/system_tray_notifier.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 void TrayAudio::DestroyDetailedView() { | 68 void TrayAudio::DestroyDetailedView() { |
| 69 if (audio_detail_view_) { | 69 if (audio_detail_view_) { |
| 70 audio_detail_view_ = nullptr; | 70 audio_detail_view_ = nullptr; |
| 71 } else if (volume_view_) { | 71 } else if (volume_view_) { |
| 72 volume_view_ = nullptr; | 72 volume_view_ = nullptr; |
| 73 pop_up_volume_view_ = false; | 73 pop_up_volume_view_ = false; |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool TrayAudio::ShouldHideArrow() const { | |
| 78 return true; | |
| 79 } | |
| 80 | |
| 81 bool TrayAudio::ShouldShowShelf() const { | 77 bool TrayAudio::ShouldShowShelf() const { |
| 82 return !pop_up_volume_view_; | 78 return !pop_up_volume_view_; |
| 83 } | 79 } |
| 84 | 80 |
| 85 void TrayAudio::OnOutputNodeVolumeChanged(uint64_t /* node_id */, | 81 void TrayAudio::OnOutputNodeVolumeChanged(uint64_t /* node_id */, |
| 86 double /* volume */) { | 82 double /* volume */) { |
| 87 float percent = | 83 float percent = |
| 88 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f; | 84 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f; |
| 89 if (tray_view()) | 85 if (tray_view()) |
| 90 tray_view()->SetVisible(GetInitialVisibility()); | 86 tray_view()->SetVisible(GetInitialVisibility()); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 volume_view_->SetVolumeLevel( | 183 volume_view_->SetVolumeLevel( |
| 188 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); | 184 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); |
| 189 volume_view_->Update(); | 185 volume_view_->Update(); |
| 190 } | 186 } |
| 191 | 187 |
| 192 if (audio_detail_view_) | 188 if (audio_detail_view_) |
| 193 audio_detail_view_->Update(); | 189 audio_detail_view_->Update(); |
| 194 } | 190 } |
| 195 | 191 |
| 196 } // namespace ash | 192 } // namespace ash |
| OLD | NEW |