OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ | |
6 #define UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "base/compiler_specific.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "ui/aura/layout_manager.h" | |
13 #include "ui/aura_shell/aura_shell_export.h" | |
14 | |
15 namespace aura { | |
16 class MouseEvent; | |
17 class Window; | |
18 } | |
19 | |
20 namespace gfx { | |
21 class Rect; | |
22 } | |
23 | |
24 namespace aura_shell { | |
25 namespace internal { | |
26 | |
27 class ShowStateController; | |
28 class WorkspaceManager; | |
29 | |
30 // LayoutManager for the default window container. | |
31 class AURA_SHELL_EXPORT DefaultContainerLayoutManager | |
32 : public aura::LayoutManager { | |
33 public: | |
34 explicit DefaultContainerLayoutManager(WorkspaceManager* workspace_manager); | |
35 virtual ~DefaultContainerLayoutManager(); | |
36 | |
37 // Returns the workspace manager for this container. | |
38 WorkspaceManager* workspace_manager() { | |
39 return workspace_manager_; | |
40 } | |
41 | |
42 // Invoked when a window receives drag event. | |
43 void PrepareForMoveOrResize(aura::Window* drag, aura::MouseEvent* event); | |
44 | |
45 // Invoked when a drag event didn't start any drag operation. | |
46 void CancelMoveOrResize(aura::Window* drag, aura::MouseEvent* event); | |
47 | |
48 // Invoked when a drag event moved the |window|. | |
49 void ProcessMove(aura::Window* window, aura::MouseEvent* event); | |
50 | |
51 // Invoked when a user finished moving window. | |
52 void EndMove(aura::Window* drag, aura::MouseEvent* evnet); | |
53 | |
54 // Invoked when a user finished resizing window. | |
55 void EndResize(aura::Window* drag, aura::MouseEvent* evnet); | |
56 | |
57 // Overridden from aura::LayoutManager: | |
58 virtual void OnWindowResized() OVERRIDE; | |
59 virtual void OnWindowAddedToLayout(aura::Window* child) OVERRIDE; | |
60 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) OVERRIDE; | |
61 virtual void OnChildWindowVisibilityChanged(aura::Window* child, | |
62 bool visibile) OVERRIDE; | |
63 virtual void SetChildBounds(aura::Window* child, | |
64 const gfx::Rect& requested_bounds) OVERRIDE; | |
65 private: | |
66 // Owned by WorkspaceController. | |
67 WorkspaceManager* workspace_manager_; | |
68 | |
69 scoped_ptr<ShowStateController> show_state_controller_; | |
70 | |
71 DISALLOW_COPY_AND_ASSIGN(DefaultContainerLayoutManager); | |
72 }; | |
73 | |
74 } // namespace internal | |
75 } // namespace aura_shell | |
76 | |
77 #endif // UI_AURA_SHELL_DEFAULT_CONTAINER_LAYOUT_MANAGER_H_ | |
OLD | NEW |