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