Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: ash/wm/lock_state_controller.cc

Issue 2101263004: mash: Migrate AccessibilityDelegate access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/lock_state_controller.h" 5 #include "ash/wm/lock_state_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 308
309 void LockStateController::StartRealShutdownTimer(bool with_animation_time) { 309 void LockStateController::StartRealShutdownTimer(bool with_animation_time) {
310 base::TimeDelta duration = 310 base::TimeDelta duration =
311 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs); 311 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs);
312 if (with_animation_time) { 312 if (with_animation_time) {
313 duration += 313 duration +=
314 animator_->GetDuration(SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); 314 animator_->GetDuration(SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN);
315 } 315 }
316 316
317 #if defined(OS_CHROMEOS) 317 #if defined(OS_CHROMEOS)
318 const AccessibilityDelegate* const delegate = 318 base::TimeDelta sound_duration =
319 Shell::GetInstance()->accessibility_delegate(); 319 WmShell::Get()->GetAccessibilityDelegate()->PlayShutdownSound();
320 base::TimeDelta sound_duration = delegate->PlayShutdownSound();
321 sound_duration = 320 sound_duration =
322 std::min(sound_duration, 321 std::min(sound_duration,
323 base::TimeDelta::FromMilliseconds(kMaxShutdownSoundDurationMs)); 322 base::TimeDelta::FromMilliseconds(kMaxShutdownSoundDurationMs));
324 duration = std::max(duration, sound_duration); 323 duration = std::max(duration, sound_duration);
325 #endif 324 #endif
326 325
327 real_shutdown_timer_.Start( 326 real_shutdown_timer_.Start(
328 FROM_HERE, duration, base::Bind(&LockStateController::OnRealPowerTimeout, 327 FROM_HERE, duration, base::Bind(&LockStateController::OnRealPowerTimeout,
329 base::Unretained(this))); 328 base::Unretained(this)));
330 } 329 }
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 SessionStateAnimator::AnimationSequence* animation_sequence) { 594 SessionStateAnimator::AnimationSequence* animation_sequence) {
596 if (unlocked_properties_.get() && 595 if (unlocked_properties_.get() &&
597 unlocked_properties_->background_is_hidden) { 596 unlocked_properties_->background_is_hidden) {
598 animation_sequence->StartAnimation(SessionStateAnimator::DESKTOP_BACKGROUND, 597 animation_sequence->StartAnimation(SessionStateAnimator::DESKTOP_BACKGROUND,
599 SessionStateAnimator::ANIMATION_FADE_OUT, 598 SessionStateAnimator::ANIMATION_FADE_OUT,
600 speed); 599 speed);
601 } 600 }
602 } 601 }
603 602
604 } // namespace ash 603 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698