summaryrefslogtreecommitdiffstats
path: root/ash/wm/visibility_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ash/wm/visibility_controller.cc')
-rw-r--r--ash/wm/visibility_controller.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/ash/wm/visibility_controller.cc b/ash/wm/visibility_controller.cc
index 17fa942..7d845c9 100644
--- a/ash/wm/visibility_controller.cc
+++ b/ash/wm/visibility_controller.cc
@@ -5,22 +5,28 @@
#include "ash/wm/visibility_controller.h"
#include "ash/shell.h"
+#include "ash/wm/window_animation_delegate.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 GetChildWindowVisibilityChangesAnimated(aura::Window* window) {
- if (!window)
+
+bool ShouldAnimateWindow(aura::Window* window) {
+ if (!window->parent() || !window->parent()->GetProperty(
+ internal::kChildWindowVisibilityChangesAnimatedKey))
return false;
- return window->GetProperty(
- internal::kChildWindowVisibilityChangesAnimatedKey);
+
+ WindowAnimationDelegate* delegate =
+ WindowAnimationDelegate::GetDelegate(window->parent());
+ return !delegate || delegate->ShouldAnimateWindow(window);
}
-} // namespace
-namespace internal {
+} // namespace
VisibilityController::VisibilityController() {
}
@@ -30,9 +36,9 @@ VisibilityController::~VisibilityController() {
void VisibilityController::UpdateLayerVisibility(aura::Window* window,
bool visible) {
- bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) &&
- window->type() != aura::client::WINDOW_TYPE_CONTROL &&
- window->type() != aura::client::WINDOW_TYPE_UNKNOWN;
+ 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) {