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