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.h" | 10 #include "ash/common/system/tray/system_tray.h" |
11 #include "ash/common/system/tray/tray_constants.h" | 11 #include "ash/common/system/tray/tray_constants.h" |
12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
13 #include "ash/common/wm_window.h" | 13 #include "ash/common/wm_window.h" |
14 #include "ash/root_window_controller.h" | 14 #include "ash/root_window_controller.h" |
15 #include "chromeos/dbus/dbus_thread_manager.h" | 15 #include "chromeos/dbus/dbus_thread_manager.h" |
16 #include "grit/ash_resources.h" | |
17 #include "ui/display/display.h" | 16 #include "ui/display/display.h" |
18 #include "ui/display/manager/managed_display_info.h" | 17 #include "ui/display/manager/managed_display_info.h" |
19 #include "ui/display/screen.h" | 18 #include "ui/display/screen.h" |
20 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
21 | 20 |
22 namespace ash { | 21 namespace ash { |
23 | 22 |
24 using chromeos::CrasAudioHandler; | 23 using chromeos::CrasAudioHandler; |
25 using chromeos::DBusThreadManager; | 24 using chromeos::DBusThreadManager; |
26 using system::TrayAudioDelegate; | 25 using system::TrayAudioDelegate; |
27 using system::TrayAudioDelegateChromeOs; | 26 using system::TrayAudioDelegateChromeOs; |
28 | 27 |
29 TrayAudio::TrayAudio(SystemTray* system_tray) | 28 TrayAudio::TrayAudio(SystemTray* system_tray) |
30 : TrayImageItem(system_tray, IDR_AURA_UBER_TRAY_VOLUME_MUTE, UMA_AUDIO), | 29 : TrayImageItem(system_tray, kSystemTrayVolumeMuteIcon, UMA_AUDIO), |
31 audio_delegate_(new TrayAudioDelegateChromeOs()), | 30 audio_delegate_(new TrayAudioDelegateChromeOs()), |
32 volume_view_(nullptr), | 31 volume_view_(nullptr), |
33 pop_up_volume_view_(false), | 32 pop_up_volume_view_(false), |
34 audio_detail_view_(nullptr) { | 33 audio_detail_view_(nullptr) { |
35 if (CrasAudioHandler::IsInitialized()) | 34 if (CrasAudioHandler::IsInitialized()) |
36 CrasAudioHandler::Get()->AddAudioObserver(this); | 35 CrasAudioHandler::Get()->AddAudioObserver(this); |
37 display::Screen::GetScreen()->AddObserver(this); | 36 display::Screen::GetScreen()->AddObserver(this); |
38 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); | 37 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); |
39 } | 38 } |
40 | 39 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 volume_view_->SetVolumeLevel( | 200 volume_view_->SetVolumeLevel( |
202 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); | 201 static_cast<float>(audio_delegate_->GetOutputVolumeLevel()) / 100.0f); |
203 volume_view_->Update(); | 202 volume_view_->Update(); |
204 } | 203 } |
205 | 204 |
206 if (audio_detail_view_) | 205 if (audio_detail_view_) |
207 audio_detail_view_->Update(); | 206 audio_detail_view_->Update(); |
208 } | 207 } |
209 | 208 |
210 } // namespace ash | 209 } // namespace ash |
OLD | NEW |