OLD | NEW |
| (Empty) |
1 // Copyright 2016 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_LAYOUT_MANAGER_H_ | |
6 #define ASH_WM_LAYOUT_MANAGER_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 | |
10 namespace gfx { | |
11 class Rect; | |
12 } | |
13 | |
14 namespace ash { | |
15 | |
16 class WmWindow; | |
17 | |
18 // Used to position the child WmWindows of a WmWindow. WmLayoutManager is called | |
19 // at key points in a WmWindows life cycle thats allow sthe WmLayoutManager to | |
20 // position or change child WmWindows. | |
21 class ASH_EXPORT WmLayoutManager { | |
22 public: | |
23 virtual ~WmLayoutManager() {} | |
24 | |
25 // Invoked when the window the WmLayoutManager is associated with is resized. | |
26 virtual void OnWindowResized() = 0; | |
27 | |
28 // Invoked when a window is added to the window the WmLayoutManager is | |
29 // associated with. | |
30 virtual void OnWindowAddedToLayout(WmWindow* child) = 0; | |
31 | |
32 // Invoked prior to removing |child|. | |
33 virtual void OnWillRemoveWindowFromLayout(WmWindow* child) = 0; | |
34 | |
35 // Invoked after removing |child|. | |
36 virtual void OnWindowRemovedFromLayout(WmWindow* child) = 0; | |
37 | |
38 // Invoked when SetVisible() is invoked on |child|. |visible| is the value | |
39 // supplied to SetVisible(). If |visible| is true, child->IsVisible() may | |
40 // still return false. See description in aura::Window::IsVisible() for | |
41 // details. | |
42 virtual void OnChildWindowVisibilityChanged(WmWindow* child, | |
43 bool visibile) = 0; | |
44 | |
45 // Invoked when WmWindow::SetBounds() is called on |child|. This allows the | |
46 // WmLayoutManager to modify the bounds as appropriate before processing the | |
47 // request, including ignoring the request. Implementation must call | |
48 // SetChildBoundsDirect() so that an infinite loop does not result. | |
49 virtual void SetChildBounds(WmWindow* child, | |
50 const gfx::Rect& requested_bounds) = 0; | |
51 }; | |
52 | |
53 } // namespace ash | |
54 | |
55 #endif // ASH_WM_LAYOUT_MANAGER_H_ | |
OLD | NEW |