diff options
author | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 21:05:20 +0000 |
---|---|---|
committer | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 21:05:20 +0000 |
commit | ce89d9393565d4757d9ba436a7bef9262671f3b2 (patch) | |
tree | 3f60b1ae1e26d929cf27644e9e1977f34d283e5f /ash/wm | |
parent | 86f438f8e442c5709e95a80bd6c1942e07b7f448 (diff) | |
download | chromium_src-ce89d9393565d4757d9ba436a7bef9262671f3b2.zip chromium_src-ce89d9393565d4757d9ba436a7bef9262671f3b2.tar.gz chromium_src-ce89d9393565d4757d9ba436a7bef9262671f3b2.tar.bz2 |
Fixed sounds registration in SoundsManager.
BUG=321335
TEST=manual tests on Lumpy, media_unittests:SoundsManager*
Review URL: https://codereview.chromium.org/108403003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm')
-rw-r--r-- | ash/wm/lock_state_controller.cc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/ash/wm/lock_state_controller.cc b/ash/wm/lock_state_controller.cc index d6c83f7..6c720ce 100644 --- a/ash/wm/lock_state_controller.cc +++ b/ash/wm/lock_state_controller.cc @@ -369,8 +369,7 @@ void LockStateController::OnPreShutdownAnimationTimeout() { StartRealShutdownTimer(false); } -void LockStateController::StartRealShutdownTimer( - bool with_animation_time) { +void LockStateController::StartRealShutdownTimer(bool with_animation_time) { base::TimeDelta duration = base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs); if (with_animation_time) { @@ -381,20 +380,15 @@ void LockStateController::StartRealShutdownTimer( #if defined(OS_CHROMEOS) const AccessibilityDelegate* const delegate = Shell::GetInstance()->accessibility_delegate(); - if (delegate->IsSpokenFeedbackEnabled()) { - const base::TimeDelta shutdown_sound_duration = std::min( - SoundsManager::Get()->GetDuration(SoundsManager::SOUND_SHUTDOWN), - base::TimeDelta::FromMilliseconds(kMaxShutdownSoundDurationMs)); - duration = std::max(duration, shutdown_sound_duration); - SoundsManager::Get()->Play(SoundsManager::SOUND_SHUTDOWN); - } + base::TimeDelta sound_duration = delegate->PlayShutdownSound(); + sound_duration = + std::min(sound_duration, + base::TimeDelta::FromMilliseconds(kMaxShutdownSoundDurationMs)); + duration = std::max(duration, sound_duration); #endif real_shutdown_timer_.Start( - FROM_HERE, - duration, - this, - &LockStateController::OnRealShutdownTimeout); + FROM_HERE, duration, this, &LockStateController::OnRealShutdownTimeout); } void LockStateController::OnRealShutdownTimeout() { |