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

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

Issue 2867673004: Use OnceCallback on Mojo interfaces in //ash (Closed)
Patch Set: count -> container_count Created 3 years, 7 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
« no previous file with comments | « ash/wm/lock_state_controller.h ('k') | ash/wm/session_state_animator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 shell->cursor_manager()->LockCursor(); 169 shell->cursor_manager()->LockCursor();
170 } 170 }
171 171
172 animator_->StartAnimation( 172 animator_->StartAnimation(
173 SessionStateAnimator::ROOT_CONTAINER, 173 SessionStateAnimator::ROOT_CONTAINER,
174 SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, 174 SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS,
175 SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); 175 SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN);
176 StartRealShutdownTimer(true); 176 StartRealShutdownTimer(true);
177 } 177 }
178 178
179 void LockStateController::OnLockScreenHide(base::Closure callback) { 179 void LockStateController::OnLockScreenHide(base::OnceClosure callback) {
180 StartUnlockAnimationBeforeUIDestroyed(callback); 180 StartUnlockAnimationBeforeUIDestroyed(std::move(callback));
181 } 181 }
182 182
183 void LockStateController::SetLockScreenDisplayedCallback( 183 void LockStateController::SetLockScreenDisplayedCallback(
184 base::OnceClosure callback) { 184 base::OnceClosure callback) {
185 DCHECK(lock_screen_displayed_callback_.is_null()); 185 DCHECK(lock_screen_displayed_callback_.is_null());
186 lock_screen_displayed_callback_ = std::move(callback); 186 lock_screen_displayed_callback_ = std::move(callback);
187 } 187 }
188 188
189 void LockStateController::OnHostCloseRequested( 189 void LockStateController::OnHostCloseRequested(
190 const aura::WindowTreeHost* host) { 190 const aura::WindowTreeHost* host) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 animator_->BeginAnimationSequence(next_animation_starter); 412 animator_->BeginAnimationSequence(next_animation_starter);
413 413
414 animation_sequence->StartAnimation( 414 animation_sequence->StartAnimation(
415 SessionStateAnimator::LOCK_SCREEN_CONTAINERS, 415 SessionStateAnimator::LOCK_SCREEN_CONTAINERS,
416 SessionStateAnimator::ANIMATION_RAISE_TO_SCREEN, 416 SessionStateAnimator::ANIMATION_RAISE_TO_SCREEN,
417 SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS); 417 SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS);
418 animation_sequence->EndSequence(); 418 animation_sequence->EndSequence();
419 } 419 }
420 420
421 void LockStateController::StartUnlockAnimationBeforeUIDestroyed( 421 void LockStateController::StartUnlockAnimationBeforeUIDestroyed(
422 base::Closure& callback) { 422 base::OnceClosure callback) {
423 VLOG(1) << "StartUnlockAnimationBeforeUIDestroyed"; 423 VLOG(1) << "StartUnlockAnimationBeforeUIDestroyed";
424 animator_->StartAnimationWithCallback( 424 animator_->StartAnimationWithCallback(
425 SessionStateAnimator::LOCK_SCREEN_CONTAINERS, 425 SessionStateAnimator::LOCK_SCREEN_CONTAINERS,
426 SessionStateAnimator::ANIMATION_LIFT, 426 SessionStateAnimator::ANIMATION_LIFT,
427 SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS, callback); 427 SessionStateAnimator::ANIMATION_SPEED_MOVE_WINDOWS, std::move(callback));
428 } 428 }
429 429
430 void LockStateController::StartUnlockAnimationAfterUIDestroyed() { 430 void LockStateController::StartUnlockAnimationAfterUIDestroyed() {
431 VLOG(1) << "StartUnlockAnimationAfterUIDestroyed"; 431 VLOG(1) << "StartUnlockAnimationAfterUIDestroyed";
432 base::Closure next_animation_starter = 432 base::Closure next_animation_starter =
433 base::Bind(&LockStateController::UnlockAnimationAfterUIDestroyedFinished, 433 base::Bind(&LockStateController::UnlockAnimationAfterUIDestroyedFinished,
434 weak_ptr_factory_.GetWeakPtr()); 434 weak_ptr_factory_.GetWeakPtr());
435 SessionStateAnimator::AnimationSequence* animation_sequence = 435 SessionStateAnimator::AnimationSequence* animation_sequence =
436 animator_->BeginAnimationSequence(next_animation_starter); 436 animator_->BeginAnimationSequence(next_animation_starter);
437 437
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 SessionStateAnimator::AnimationSpeed speed, 552 SessionStateAnimator::AnimationSpeed speed,
553 SessionStateAnimator::AnimationSequence* animation_sequence) { 553 SessionStateAnimator::AnimationSequence* animation_sequence) {
554 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) { 554 if (unlocked_properties_.get() && unlocked_properties_->wallpaper_is_hidden) {
555 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER, 555 animation_sequence->StartAnimation(SessionStateAnimator::WALLPAPER,
556 SessionStateAnimator::ANIMATION_FADE_OUT, 556 SessionStateAnimator::ANIMATION_FADE_OUT,
557 speed); 557 speed);
558 } 558 }
559 } 559 }
560 560
561 } // namespace ash 561 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/lock_state_controller.h ('k') | ash/wm/session_state_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698