| 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/audio/tray_audio.h" | 5 #include "ash/system/audio/tray_audio.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "ui/gfx/image/image.h" | 33 #include "ui/gfx/image/image.h" |
| 34 #include "ui/gfx/image/image_skia_operations.h" | 34 #include "ui/gfx/image/image_skia_operations.h" |
| 35 #include "ui/views/controls/button/image_button.h" | 35 #include "ui/views/controls/button/image_button.h" |
| 36 #include "ui/views/controls/image_view.h" | 36 #include "ui/views/controls/image_view.h" |
| 37 #include "ui/views/controls/label.h" | 37 #include "ui/views/controls/label.h" |
| 38 #include "ui/views/controls/slider.h" | 38 #include "ui/views/controls/slider.h" |
| 39 #include "ui/views/layout/box_layout.h" | 39 #include "ui/views/layout/box_layout.h" |
| 40 #include "ui/views/view.h" | 40 #include "ui/views/view.h" |
| 41 | 41 |
| 42 namespace ash { | 42 namespace ash { |
| 43 namespace internal { | |
| 44 | 43 |
| 45 TrayAudio::TrayAudio(SystemTray* system_tray, | 44 TrayAudio::TrayAudio(SystemTray* system_tray, |
| 46 scoped_ptr<system::TrayAudioDelegate> audio_delegate) | 45 scoped_ptr<system::TrayAudioDelegate> audio_delegate) |
| 47 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_VOLUME_MUTE), | 46 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_VOLUME_MUTE), |
| 48 audio_delegate_(audio_delegate.Pass()), | 47 audio_delegate_(audio_delegate.Pass()), |
| 49 volume_view_(NULL), | 48 volume_view_(NULL), |
| 50 pop_up_volume_view_(false) { | 49 pop_up_volume_view_(false) { |
| 51 Shell::GetInstance()->system_tray_notifier()->AddAudioObserver(this); | 50 Shell::GetInstance()->system_tray_notifier()->AddAudioObserver(this); |
| 52 } | 51 } |
| 53 | 52 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 void TrayAudio::Update() { | 139 void TrayAudio::Update() { |
| 141 if (tray_view()) | 140 if (tray_view()) |
| 142 tray_view()->SetVisible(GetInitialVisibility()); | 141 tray_view()->SetVisible(GetInitialVisibility()); |
| 143 if (volume_view_) { | 142 if (volume_view_) { |
| 144 volume_view_->SetVolumeLevel( | 143 volume_view_->SetVolumeLevel( |
| 145 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); | 144 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); |
| 146 volume_view_->Update(); | 145 volume_view_->Update(); |
| 147 } | 146 } |
| 148 } | 147 } |
| 149 | 148 |
| 150 } // namespace internal | |
| 151 } // namespace ash | 149 } // namespace ash |
| OLD | NEW |