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_AURA_AURA_LAYOUT_MANAGER_ADAPTER_H_ | |
6 #define ASH_WM_AURA_AURA_LAYOUT_MANAGER_ADAPTER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "base/macros.h" | |
12 #include "ui/aura/layout_manager.h" | |
13 | |
14 namespace ash { | |
15 namespace wm { | |
16 | |
17 class WmLayoutManager; | |
18 | |
19 // AuraLayoutManagerAdapter is an aura::LayoutManager that calls to | |
20 // WmLayoutManager. Use it when you have a WmLayoutManager you want to use | |
21 // with an aura::Window. | |
22 class ASH_EXPORT AuraLayoutManagerAdapter : public aura::LayoutManager { | |
23 public: | |
24 explicit AuraLayoutManagerAdapter( | |
25 std::unique_ptr<WmLayoutManager> wm_layout_manager); | |
26 ~AuraLayoutManagerAdapter() override; | |
27 | |
28 WmLayoutManager* wm_layout_manager() { return wm_layout_manager_.get(); } | |
29 | |
30 // aura::LayoutManager: | |
31 void OnWindowResized() override; | |
32 void OnWindowAddedToLayout(aura::Window* child) override; | |
33 void OnWillRemoveWindowFromLayout(aura::Window* child) override; | |
34 void OnWindowRemovedFromLayout(aura::Window* child) override; | |
35 void OnChildWindowVisibilityChanged(aura::Window* child, | |
36 bool visible) override; | |
37 void SetChildBounds(aura::Window* child, | |
38 const gfx::Rect& requested_bounds) override; | |
39 | |
40 private: | |
41 std::unique_ptr<WmLayoutManager> wm_layout_manager_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(AuraLayoutManagerAdapter); | |
44 }; | |
45 | |
46 } // namespace wm | |
47 } // namespace ash | |
48 | |
49 #endif // ASH_WM_AURA_AURA_LAYOUT_MANAGER_ADAPTER_H_ | |
OLD | NEW |