| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_WM_VISIBILITY_CONTROLLER_H_ | |
| 6 #define ASH_WM_VISIBILITY_CONTROLLER_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "base/logging.h" | |
| 11 #include "ui/aura/client/visibility_client.h" | |
| 12 | |
| 13 namespace ash { | |
| 14 namespace internal { | |
| 15 | |
| 16 class ASH_EXPORT VisibilityController : public aura::client::VisibilityClient { | |
| 17 public: | |
| 18 VisibilityController(); | |
| 19 virtual ~VisibilityController(); | |
| 20 | |
| 21 // Overridden from aura::client::VisibilityClient: | |
| 22 virtual void UpdateLayerVisibility(aura::Window* window, | |
| 23 bool visible) OVERRIDE; | |
| 24 | |
| 25 private: | |
| 26 DISALLOW_COPY_AND_ASSIGN(VisibilityController); | |
| 27 }; | |
| 28 | |
| 29 } // namespace internal | |
| 30 | |
| 31 // Suspends the animations for visibility changes during the lifetime of an | |
| 32 // instance of this class. | |
| 33 // | |
| 34 // Example: | |
| 35 // | |
| 36 // void ViewName::UnanimatedAction() { | |
| 37 // SuspendChildWindowVisibilityAnimations suspend(parent); | |
| 38 // // Perform unanimated action here. | |
| 39 // // ... | |
| 40 // // When the method finishes, visibility animations will return to their | |
| 41 // // previous state. | |
| 42 // } | |
| 43 // | |
| 44 class ASH_EXPORT SuspendChildWindowVisibilityAnimations { | |
| 45 public: | |
| 46 // Suspend visibility animations of child windows. | |
| 47 explicit SuspendChildWindowVisibilityAnimations(aura::Window* window); | |
| 48 | |
| 49 // Restore visibility animations to their original state. | |
| 50 ~SuspendChildWindowVisibilityAnimations(); | |
| 51 | |
| 52 private: | |
| 53 // The window to manage. | |
| 54 aura::Window* window_; | |
| 55 | |
| 56 // Whether the visibility animations on child windows were originally enabled. | |
| 57 const bool original_enabled_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations); | |
| 60 }; | |
| 61 | |
| 62 // Tells |window| to animate visibility changes to its children. | |
| 63 void ASH_EXPORT SetChildWindowVisibilityChangesAnimated(aura::Window* window); | |
| 64 | |
| 65 } // namespace ash | |
| 66 | |
| 67 #endif // ASH_WM_VISIBILITY_CONTROLLER_H_ | |
| OLD | NEW |