| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ash/system/chromeos/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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 const int kExtraPaddingBetweenBarAndMore = 10; | 50 const int kExtraPaddingBetweenBarAndMore = 10; |
| 51 | 51 |
| 52 const int kNoAudioDeviceIcon = -1; | 52 const int kNoAudioDeviceIcon = -1; |
| 53 | 53 |
| 54 // IDR_AURA_UBER_TRAY_VOLUME_LEVELS contains 5 images, | 54 // IDR_AURA_UBER_TRAY_VOLUME_LEVELS contains 5 images, |
| 55 // The one for mute is at the 0 index and the other | 55 // The one for mute is at the 0 index and the other |
| 56 // four are used for ascending volume levels. | 56 // four are used for ascending volume levels. |
| 57 const int kVolumeLevels = 4; | 57 const int kVolumeLevels = 4; |
| 58 | 58 |
| 59 bool UseNewAudioHandler() { | 59 bool UseNewAudioHandler() { |
| 60 return CommandLine::ForCurrentProcess()-> | 60 return !CommandLine::ForCurrentProcess()-> |
| 61 HasSwitch(ash::switches::kAshEnableNewAudioHandler); | 61 HasSwitch(ash::switches::kAshDisableNewAudioHandler); |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool IsAudioMuted() { | 64 bool IsAudioMuted() { |
| 65 if(UseNewAudioHandler()) { | 65 if(UseNewAudioHandler()) { |
| 66 return chromeos::CrasAudioHandler::Get()->IsOutputMuted(); | 66 return chromeos::CrasAudioHandler::Get()->IsOutputMuted(); |
| 67 } else { | 67 } else { |
| 68 return Shell::GetInstance()->system_tray_delegate()-> | 68 return Shell::GetInstance()->system_tray_delegate()-> |
| 69 GetVolumeControlDelegate()->IsAudioMuted(); | 69 GetVolumeControlDelegate()->IsAudioMuted(); |
| 70 } | 70 } |
| 71 } | 71 } |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 | 603 |
| 604 void TrayAudio::Update() { | 604 void TrayAudio::Update() { |
| 605 if (audio_detail_) | 605 if (audio_detail_) |
| 606 audio_detail_->Update(); | 606 audio_detail_->Update(); |
| 607 if (volume_view_) | 607 if (volume_view_) |
| 608 volume_view_->Update(); | 608 volume_view_->Update(); |
| 609 } | 609 } |
| 610 | 610 |
| 611 } // namespace internal | 611 } // namespace internal |
| 612 } // namespace ash | 612 } // namespace ash |
| OLD | NEW |