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/wm_export.h" |
12 | 12 |
13 namespace wm { | 13 namespace wm { |
14 | 14 |
15 class WM_EXPORT VisibilityController | 15 class WM_EXPORT VisibilityController |
16 : public aura::client::VisibilityClient { | 16 : public aura::client::VisibilityClient { |
17 public: | 17 public: |
18 VisibilityController(); | 18 VisibilityController(); |
19 virtual ~VisibilityController(); | 19 ~VisibilityController() override; |
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. |
26 virtual bool CallAnimateOnChildWindowVisibilityChanged(aura::Window* window, | 26 virtual bool CallAnimateOnChildWindowVisibilityChanged(aura::Window* window, |
27 bool visible); | 27 bool visible); |
28 | 28 |
29 private: | 29 private: |
30 // Overridden from aura::client::VisibilityClient: | 30 // Overridden from aura::client::VisibilityClient: |
31 virtual void UpdateLayerVisibility(aura::Window* window, | 31 void UpdateLayerVisibility(aura::Window* window, bool visible) override; |
32 bool visible) override; | |
33 | 32 |
34 DISALLOW_COPY_AND_ASSIGN(VisibilityController); | 33 DISALLOW_COPY_AND_ASSIGN(VisibilityController); |
35 }; | 34 }; |
36 | 35 |
37 // Suspends the animations for visibility changes during the lifetime of an | 36 // Suspends the animations for visibility changes during the lifetime of an |
38 // instance of this class. | 37 // instance of this class. |
39 // | 38 // |
40 // Example: | 39 // Example: |
41 // | 40 // |
42 // void ViewName::UnanimatedAction() { | 41 // void ViewName::UnanimatedAction() { |
(...skipping 22 matching lines...) Expand all Loading... |
65 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations); | 64 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations); |
66 }; | 65 }; |
67 | 66 |
68 // Tells |window| to animate visibility changes to its children. | 67 // Tells |window| to animate visibility changes to its children. |
69 void WM_EXPORT SetChildWindowVisibilityChangesAnimated( | 68 void WM_EXPORT SetChildWindowVisibilityChangesAnimated( |
70 aura::Window* window); | 69 aura::Window* window); |
71 | 70 |
72 } // namespace wm | 71 } // namespace wm |
73 | 72 |
74 #endif // UI_WM_CORE_VISIBILITY_CONTROLLER_H_ | 73 #endif // UI_WM_CORE_VISIBILITY_CONTROLLER_H_ |
OLD | NEW |