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

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

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/screen_dimmer_unittest.cc ('k') | ash/wm/stacking_controller.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 (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/wm/session_state_animator.h" 5 #include "ash/wm/session_state_animator.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_animations.h" 9 #include "ash/wm/window_animations.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 aura::Window* window = *it; 396 aura::Window* window = *it;
397 ui::Layer* layer = window->layer(); 397 ui::Layer* layer = window->layer();
398 if (!IsLayerAnimated(layer, type)) 398 if (!IsLayerAnimated(layer, type))
399 return false; 399 return false;
400 } 400 }
401 return true; 401 return true;
402 } 402 }
403 403
404 bool SessionStateAnimator::TestApi::RootWindowIsAnimated(AnimationType type) 404 bool SessionStateAnimator::TestApi::RootWindowIsAnimated(AnimationType type)
405 const { 405 const {
406 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); 406 aura::Window* root_window = Shell::GetPrimaryRootWindow();
407 ui::Layer* layer = root_window->layer(); 407 ui::Layer* layer = root_window->layer();
408 return IsLayerAnimated(layer, type); 408 return IsLayerAnimated(layer, type);
409 } 409 }
410 410
411 const int SessionStateAnimator::kAllLockScreenContainersMask = 411 const int SessionStateAnimator::kAllLockScreenContainersMask =
412 SessionStateAnimator::LOCK_SCREEN_BACKGROUND | 412 SessionStateAnimator::LOCK_SCREEN_BACKGROUND |
413 SessionStateAnimator::LOCK_SCREEN_CONTAINERS | 413 SessionStateAnimator::LOCK_SCREEN_CONTAINERS |
414 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS; 414 SessionStateAnimator::LOCK_SCREEN_RELATED_CONTAINERS;
415 415
416 const int SessionStateAnimator::kAllContainersMask = 416 const int SessionStateAnimator::kAllContainersMask =
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 448 }
449 // Satisfy compilers that do not understand that we will return from switch 449 // Satisfy compilers that do not understand that we will return from switch
450 // above anyway. 450 // above anyway.
451 DCHECK(false) << "Unhandled animation speed " << speed; 451 DCHECK(false) << "Unhandled animation speed " << speed;
452 return base::TimeDelta(); 452 return base::TimeDelta();
453 } 453 }
454 454
455 // Fills |containers| with the containers described by |container_mask|. 455 // Fills |containers| with the containers described by |container_mask|.
456 void SessionStateAnimator::GetContainers(int container_mask, 456 void SessionStateAnimator::GetContainers(int container_mask,
457 aura::Window::Windows* containers) { 457 aura::Window::Windows* containers) {
458 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); 458 aura::Window* root_window = Shell::GetPrimaryRootWindow();
459 containers->clear(); 459 containers->clear();
460 460
461 if (container_mask & DESKTOP_BACKGROUND) { 461 if (container_mask & DESKTOP_BACKGROUND) {
462 containers->push_back(Shell::GetContainer( 462 containers->push_back(Shell::GetContainer(
463 root_window, 463 root_window,
464 internal::kShellWindowId_DesktopBackgroundContainer)); 464 internal::kShellWindowId_DesktopBackgroundContainer));
465 } 465 }
466 if (container_mask & LAUNCHER) { 466 if (container_mask & LAUNCHER) {
467 containers->push_back(Shell::GetContainer( 467 containers->push_back(Shell::GetContainer(
468 root_window, 468 root_window,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 aura::Window::Windows containers; 535 aura::Window::Windows containers;
536 GetContainers(container_mask, &containers); 536 GetContainers(container_mask, &containers);
537 for (aura::Window::Windows::const_iterator it = containers.begin(); 537 for (aura::Window::Windows::const_iterator it = containers.begin();
538 it != containers.end(); ++it) { 538 it != containers.end(); ++it) {
539 RunAnimationForWindow(*it, type, speed, observer); 539 RunAnimationForWindow(*it, type, speed, observer);
540 } 540 }
541 } 541 }
542 542
543 void SessionStateAnimator::StartGlobalAnimation(AnimationType type, 543 void SessionStateAnimator::StartGlobalAnimation(AnimationType type,
544 AnimationSpeed speed) { 544 AnimationSpeed speed) {
545 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); 545 aura::Window* root_window = Shell::GetPrimaryRootWindow();
546 RunAnimationForWindow(root_window, type, speed, NULL); 546 RunAnimationForWindow(root_window, type, speed, NULL);
547 } 547 }
548 548
549 void SessionStateAnimator::RunAnimationForWindow( 549 void SessionStateAnimator::RunAnimationForWindow(
550 aura::Window* window, 550 aura::Window* window,
551 AnimationType type, 551 AnimationType type,
552 AnimationSpeed speed, 552 AnimationSpeed speed,
553 ui::LayerAnimationObserver* observer) { 553 ui::LayerAnimationObserver* observer) {
554 base::TimeDelta duration = GetDuration(speed); 554 base::TimeDelta duration = GetDuration(speed);
555 555
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 foreground_->SetColor(SK_ColorWHITE); 625 foreground_->SetColor(SK_ColorWHITE);
626 foreground_->GetWidget()->Show(); 626 foreground_->GetWidget()->Show();
627 } 627 }
628 628
629 void SessionStateAnimator::DropForeground() { 629 void SessionStateAnimator::DropForeground() {
630 foreground_.reset(); 630 foreground_.reset();
631 } 631 }
632 632
633 } // namespace internal 633 } // namespace internal
634 } // namespace ash 634 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/screen_dimmer_unittest.cc ('k') | ash/wm/stacking_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698