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