OLD | NEW |
| (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 ASH_WM_COMMON_ALWAYS_ON_TOP_CONTROLLER_H_ | |
6 #define ASH_WM_COMMON_ALWAYS_ON_TOP_CONTROLLER_H_ | |
7 | |
8 #include <memory> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "ash/wm/common/wm_window_observer.h" | |
12 #include "base/macros.h" | |
13 | |
14 namespace ash { | |
15 class WorkspaceLayoutManager; | |
16 | |
17 // AlwaysOnTopController puts window into proper containers based on its | |
18 // 'AlwaysOnTop' property. That is, putting a window into the worskpace | |
19 // container if its "AlwaysOnTop" property is false. Otherwise, put it in | |
20 // |always_on_top_container_|. | |
21 class ASH_EXPORT AlwaysOnTopController : public wm::WmWindowObserver { | |
22 public: | |
23 explicit AlwaysOnTopController(wm::WmWindow* viewport); | |
24 ~AlwaysOnTopController() override; | |
25 | |
26 // Gets container for given |window| based on its "AlwaysOnTop" property. | |
27 wm::WmWindow* GetContainer(wm::WmWindow* window) const; | |
28 | |
29 WorkspaceLayoutManager* GetLayoutManager() const; | |
30 | |
31 void SetLayoutManagerForTest( | |
32 std::unique_ptr<WorkspaceLayoutManager> layout_manager); | |
33 | |
34 private: | |
35 // Overridden from wm::WmWindowObserver: | |
36 void OnWindowTreeChanged(wm::WmWindow* window, | |
37 const TreeChangeParams& params) override; | |
38 void OnWindowPropertyChanged(wm::WmWindow* window, | |
39 wm::WmWindowProperty property) override; | |
40 void OnWindowDestroying(wm::WmWindow* window) override; | |
41 | |
42 wm::WmWindow* always_on_top_container_; | |
43 | |
44 DISALLOW_COPY_AND_ASSIGN(AlwaysOnTopController); | |
45 }; | |
46 | |
47 } // namepsace ash | |
48 | |
49 #endif // ASH_WM_COMMON_ALWAYS_ON_TOP_CONTROLLER_H_ | |
OLD | NEW |