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

Unified Diff: ui/views/corewm/visibility_controller.cc

Issue 194843004: Move files from ui/views/corewm to ui/wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/visibility_controller.h ('k') | ui/views/corewm/visibility_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/visibility_controller.cc
diff --git a/ui/views/corewm/visibility_controller.cc b/ui/views/corewm/visibility_controller.cc
deleted file mode 100644
index c34f4f379f8689019251f99966f128bcb813fd06..0000000000000000000000000000000000000000
--- a/ui/views/corewm/visibility_controller.cc
+++ /dev/null
@@ -1,87 +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 "ui/views/corewm/visibility_controller.h"
-
-#include "ui/aura/window.h"
-#include "ui/aura/window_property.h"
-#include "ui/compositor/layer.h"
-#include "ui/views/corewm/window_animations.h"
-
-namespace views {
-namespace corewm {
-
-namespace {
-
-// Property set on all windows whose child windows' visibility changes are
-// animated.
-DEFINE_WINDOW_PROPERTY_KEY(
- bool, kChildWindowVisibilityChangesAnimatedKey, false);
-
-bool ShouldAnimateWindow(aura::Window* window) {
- return window->parent() && window->parent()->GetProperty(
- kChildWindowVisibilityChangesAnimatedKey);
-}
-
-} // namespace
-
-VisibilityController::VisibilityController() {
-}
-
-VisibilityController::~VisibilityController() {
-}
-
-bool VisibilityController::CallAnimateOnChildWindowVisibilityChanged(
- aura::Window* window,
- bool visible) {
- return AnimateOnChildWindowVisibilityChanged(window, visible);
-}
-
-void VisibilityController::UpdateLayerVisibility(aura::Window* window,
- bool visible) {
- bool animated = window->type() != ui::wm::WINDOW_TYPE_CONTROL &&
- window->type() != ui::wm::WINDOW_TYPE_UNKNOWN &&
- ShouldAnimateWindow(window);
- animated = animated &&
- CallAnimateOnChildWindowVisibilityChanged(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);
-}
-
-SuspendChildWindowVisibilityAnimations::SuspendChildWindowVisibilityAnimations(
- aura::Window* window)
- : window_(window),
- original_enabled_(window->GetProperty(
- kChildWindowVisibilityChangesAnimatedKey)) {
- window_->ClearProperty(kChildWindowVisibilityChangesAnimatedKey);
-}
-
-SuspendChildWindowVisibilityAnimations::
- ~SuspendChildWindowVisibilityAnimations() {
- if (original_enabled_)
- window_->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true);
- else
- window_->ClearProperty(kChildWindowVisibilityChangesAnimatedKey);
-}
-
-void SetChildWindowVisibilityChangesAnimated(aura::Window* window) {
- window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true);
-}
-
-} // namespace corewm
-} // namespace views
-
« no previous file with comments | « ui/views/corewm/visibility_controller.h ('k') | ui/views/corewm/visibility_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698