Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: ui/views/corewm/visibility_controller.h

Issue 194843004: Move files from ui/views/corewm to ui/wm/core (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 UI_VIEWS_COREWM_VISIBILITY_CONTROLLER_H_
6 #define UI_VIEWS_COREWM_VISIBILITY_CONTROLLER_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/logging.h"
10 #include "ui/aura/client/visibility_client.h"
11 #include "ui/views/views_export.h"
12
13 namespace views {
14 namespace corewm {
15
16 class VIEWS_EXPORT VisibilityController
17 : public aura::client::VisibilityClient {
18 public:
19 VisibilityController();
20 virtual ~VisibilityController();
21
22 protected:
23 // Subclasses override if they want to call a different implementation of
24 // this function.
25 // TODO(beng): potentially replace by an actual window animator class in
26 // window_animations.h.
27 virtual bool CallAnimateOnChildWindowVisibilityChanged(aura::Window* window,
28 bool visible);
29
30 private:
31 // Overridden from aura::client::VisibilityClient:
32 virtual void UpdateLayerVisibility(aura::Window* window,
33 bool visible) OVERRIDE;
34
35 DISALLOW_COPY_AND_ASSIGN(VisibilityController);
36 };
37
38 // Suspends the animations for visibility changes during the lifetime of an
39 // instance of this class.
40 //
41 // Example:
42 //
43 // void ViewName::UnanimatedAction() {
44 // SuspendChildWindowVisibilityAnimations suspend(parent);
45 // // Perform unanimated action here.
46 // // ...
47 // // When the method finishes, visibility animations will return to their
48 // // previous state.
49 // }
50 //
51 class VIEWS_EXPORT SuspendChildWindowVisibilityAnimations {
52 public:
53 // Suspend visibility animations of child windows.
54 explicit SuspendChildWindowVisibilityAnimations(aura::Window* window);
55
56 // Restore visibility animations to their original state.
57 ~SuspendChildWindowVisibilityAnimations();
58
59 private:
60 // The window to manage.
61 aura::Window* window_;
62
63 // Whether the visibility animations on child windows were originally enabled.
64 const bool original_enabled_;
65
66 DISALLOW_COPY_AND_ASSIGN(SuspendChildWindowVisibilityAnimations);
67 };
68
69 // Tells |window| to animate visibility changes to its children.
70 void VIEWS_EXPORT SetChildWindowVisibilityChangesAnimated(aura::Window* window);
71
72 } // namespace corewm
73 } // namespace views
74
75 #endif // UI_VIEWS_COREWM_VISIBILITY_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/views/corewm/transient_window_stacking_client_unittest.cc ('k') | ui/views/corewm/visibility_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698