| OLD | NEW |
| 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 "ui/wm/core/visibility_controller.h" | 5 #include "ui/wm/core/visibility_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_property.h" | 8 #include "ui/base/class_property.h" |
| 9 #include "ui/compositor/layer.h" | 9 #include "ui/compositor/layer.h" |
| 10 #include "ui/wm/core/window_animations.h" | 10 #include "ui/wm/core/window_animations.h" |
| 11 | 11 |
| 12 namespace wm { | 12 namespace wm { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 // Property set on all windows whose child windows' visibility changes are | 16 // Property set on all windows whose child windows' visibility changes are |
| 17 // animated. | 17 // animated. |
| 18 DEFINE_WINDOW_PROPERTY_KEY( | 18 DEFINE_CLASS_PROPERTY_KEY( |
| 19 bool, kChildWindowVisibilityChangesAnimatedKey, false); | 19 bool, kChildWindowVisibilityChangesAnimatedKey, false); |
| 20 | 20 |
| 21 // A window with this property set will animate upon its visibility changes. | 21 // A window with this property set will animate upon its visibility changes. |
| 22 DEFINE_WINDOW_PROPERTY_KEY(bool, kWindowVisibilityChangesAnimatedKey, false); | 22 DEFINE_CLASS_PROPERTY_KEY(bool, kWindowVisibilityChangesAnimatedKey, false); |
| 23 | 23 |
| 24 bool ShouldAnimateWindow(aura::Window* window) { | 24 bool ShouldAnimateWindow(aura::Window* window) { |
| 25 return (window->parent() && | 25 return (window->parent() && |
| 26 window->parent()->GetProperty( | 26 window->parent()->GetProperty( |
| 27 kChildWindowVisibilityChangesAnimatedKey)) || | 27 kChildWindowVisibilityChangesAnimatedKey)) || |
| 28 window->GetProperty(kWindowVisibilityChangesAnimatedKey); | 28 window->GetProperty(kWindowVisibilityChangesAnimatedKey); |
| 29 } | 29 } |
| 30 | 30 |
| 31 } // namespace | 31 } // namespace |
| 32 | 32 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 void SetWindowVisibilityChangesAnimated(aura::Window* window) { | 89 void SetWindowVisibilityChangesAnimated(aura::Window* window) { |
| 90 window->SetProperty(kWindowVisibilityChangesAnimatedKey, true); | 90 window->SetProperty(kWindowVisibilityChangesAnimatedKey, true); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 93 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
| 94 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); | 94 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace wm | 97 } // namespace wm |
| OLD | NEW |