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

Unified Diff: ash/wm/visibility_controller.cc

Issue 11316245: Move VisibilityController to corewm. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/visibility_controller.h ('k') | ash/wm/visibility_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/visibility_controller.cc
===================================================================
--- ash/wm/visibility_controller.cc (revision 170313)
+++ ash/wm/visibility_controller.cc (working copy)
@@ -1,78 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/wm/visibility_controller.h"
-
-#include "ash/shell.h"
-#include "ash/wm/window_animations.h"
-#include "ash/wm/window_properties.h"
-#include "ui/aura/window.h"
-#include "ui/compositor/layer.h"
-
-namespace ash {
-namespace internal {
-
-namespace {
-
-bool ShouldAnimateWindow(aura::Window* window) {
- return window->parent() && window->parent()->GetProperty(
- internal::kChildWindowVisibilityChangesAnimatedKey);
-}
-
-} // namespace
-
-VisibilityController::VisibilityController() {
-}
-
-VisibilityController::~VisibilityController() {
-}
-
-void VisibilityController::UpdateLayerVisibility(aura::Window* window,
- bool visible) {
- bool animated = window->type() != aura::client::WINDOW_TYPE_CONTROL &&
- window->type() != aura::client::WINDOW_TYPE_UNKNOWN &&
- ShouldAnimateWindow(window);
- animated = animated && AnimateOnChildWindowVisibilityChanged(window, visible);
-
- if (!visible) {
- // For window hiding animation, we want to check if the window is already
- // animating, and not do SetVisible(false) if it is.
- // TODO(vollick): remove this.
- animated = animated || (window->layer()->GetAnimator()->
- IsAnimatingProperty(ui::LayerAnimationElement::OPACITY) &&
- window->layer()->GetTargetOpacity() == 0.0f);
- }
-
- // When a window is made visible, we always make its layer visible
- // immediately. When a window is hidden, the layer must be left visible and
- // only made not visible once the animation is complete.
- if (!animated || visible)
- window->layer()->SetVisible(visible);
-}
-
-} // namespace internal
-
-SuspendChildWindowVisibilityAnimations::SuspendChildWindowVisibilityAnimations(
- aura::Window* window)
- : window_(window),
- original_enabled_(window->GetProperty(
- internal::kChildWindowVisibilityChangesAnimatedKey)) {
- window_->ClearProperty(internal::kChildWindowVisibilityChangesAnimatedKey);
-}
-
-SuspendChildWindowVisibilityAnimations::
- ~SuspendChildWindowVisibilityAnimations() {
- if (original_enabled_) {
- window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey,
- true);
- } else {
- window_->ClearProperty(internal::kChildWindowVisibilityChangesAnimatedKey);
- }
-}
-
-void SetChildWindowVisibilityChangesAnimated(aura::Window* window) {
- window->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, true);
-}
-
-} // namespace ash
« no previous file with comments | « ash/wm/visibility_controller.h ('k') | ash/wm/visibility_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698