| 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 #ifndef UI_WM_CORE_VISIBILITY_CONTROLLER_H_ | 5 #ifndef UI_WM_CORE_VISIBILITY_CONTROLLER_H_ |
| 6 #define UI_WM_CORE_VISIBILITY_CONTROLLER_H_ | 6 #define UI_WM_CORE_VISIBILITY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ui/aura/client/visibility_client.h" | 10 #include "ui/aura/client/visibility_client.h" |
| 11 #include "ui/wm/wm_export.h" | 11 #include "ui/wm/core/wm_core_export.h" |
| 12 | 12 |
| 13 namespace wm { | 13 namespace wm { |
| 14 | 14 |
| 15 class WM_EXPORT VisibilityController | 15 class WM_CORE_EXPORT VisibilityController |
| 16 : public aura::client::VisibilityClient { | 16 : public aura::client::VisibilityClient { |
| 17 public: | 17 public: |
| 18 VisibilityController(); | 18 VisibilityController(); |
| 19 virtual ~VisibilityController(); | 19 virtual ~VisibilityController(); |
| 20 | 20 |
| 21 protected: | 21 protected: |
| 22 // Subclasses override if they want to call a different implementation of | 22 // Subclasses override if they want to call a different implementation of |
| 23 // this function. | 23 // this function. |
| 24 // TODO(beng): potentially replace by an actual window animator class in | 24 // TODO(beng): potentially replace by an actual window animator class in |
| 25 // window_animations.h. | 25 // window_animations.h. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 40 // Example: | 40 // Example: |
| 41 // | 41 // |
| 42 // void ViewName::UnanimatedAction() { | 42 // void ViewName::UnanimatedAction() { |
| 43 // SuspendChildWindowVisibilityAnimations suspend(parent); | 43 // SuspendChildWindowVisibilityAnimations suspend(parent); |
| 44 // // Perform unanimated action here. | 44 // // Perform unanimated action here. |
| 45 // // ... | 45 // // ... |
| 46 // // When the method finishes, visibility animations will return to their | 46 // // When the method finishes, visibility animations will return to their |
| 47 // // previous state. | 47 // // previous state. |
| 48 // } | 48 // } |
| 49 // | 49 // |
| 50 class WM_EXPORT SuspendChildWindowVisibilityAnimations { | 50 class WM_CORE_EXPORT SuspendChildWindowVisibilityAnimations { |
| 51 public: | 51 public: |
| 52 // Suspend visibility animations of child windows. | 52 // Suspend visibility animations of child windows. |
| 53 explicit SuspendChildWindowVisibilityAnimations(aura::Window* window); | 53 explicit SuspendChildWindowVisibilityAnimations(aura::Window* window); |
| 54 | 54 |
| 55 // Restore visibility animations to their original state. | 55 // Restore visibility animations to their original state. |
| 56 ~SuspendChildWindowVisibilityAnimations(); | 56 ~SuspendChildWindowVisibilityAnimations(); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 // The window to manage. | 59 // The window to manage. |
| 60 aura::Window* window_; | 60 aura::Window* window_; |
| 61 | 61 |
| 62 // Whether the visibility animations on child windows were originally enabled. | 62 // Whether the visibility animations on child windows were originally enabled. |
| 63 const bool original_enabled_; | 63 const bool original_enabled_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations); | 65 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // Tells |window| to animate visibility changes to its children. | 68 // Tells |window| to animate visibility changes to its children. |
| 69 void WM_EXPORT SetChildWindowVisibilityChangesAnimated( | 69 void WM_CORE_EXPORT SetChildWindowVisibilityChangesAnimated( |
| 70 aura::Window* window); | 70 aura::Window* window); |
| 71 | 71 |
| 72 } // namespace wm | 72 } // namespace wm |
| 73 | 73 |
| 74 #endif // UI_WM_CORE_VISIBILITY_CONTROLLER_H_ | 74 #endif // UI_WM_CORE_VISIBILITY_CONTROLLER_H_ |
| OLD | NEW |