| 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_PINNED_CONTROLLER_H_ |
| 6 #define ASH_WM_PINNED_CONTROLLER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "ash/common/shell_observer.h" |
| 11 #include "ash/common/wm_window_observer.h" |
| 12 #include "ash/display/window_tree_host_manager.h" |
| 13 #include "base/macros.h" |
| 14 |
| 15 namespace ash { |
| 16 |
| 17 class WmWindow; |
| 18 |
| 19 namespace wm { |
| 20 |
| 21 // Handles pinned state. |
| 22 class PinnedController : public ShellObserver, |
| 23 public WmWindowObserver, |
| 24 public WindowTreeHostManager::Observer { |
| 25 public: |
| 26 PinnedController(); |
| 27 ~PinnedController() override; |
| 28 |
| 29 // Returns true if in pinned mode, otherwise false. |
| 30 bool IsPinned() const; |
| 31 |
| 32 private: |
| 33 // Pinned window should be on top in the parent window. |
| 34 WmWindow* pinned_window_ = nullptr; |
| 35 // Dim background window just behind of the pinned window. |
| 36 // Not owned. The parent has its ownership. |
| 37 WmWindow* background_window_ = nullptr; |
| 38 // In pinned mode, all displays other than the one where pinned_window_ is. |
| 39 // Similar to background_window_, not owned. |
| 40 std::vector<WmWindow*> dim_windows_; |
| 41 // Set true only when restacking done by this controller. |
| 42 bool in_restacking_ = false; |
| 43 |
| 44 // Keeps the pinned window on top of the siblings. |
| 45 void KeepPinnedWindowOnTop(); |
| 46 |
| 47 // Keeps the dim window on top of the container. |
| 48 void KeepDimWindowOnTop(WmWindow* container); |
| 49 |
| 50 // ShellObserver override. |
| 51 void OnPinnedStateChanged(WmWindow* pinned_window) override; |
| 52 |
| 53 // WmWindowObserver override. |
| 54 void OnWindowTreeChanging(WmWindow* window, |
| 55 const TreeChangeParams& params) override; |
| 56 void OnWindowTreeChanged(WmWindow* window, |
| 57 const TreeChangeParams& params) override; |
| 58 void OnWindowStackingChanged(WmWindow* window) override; |
| 59 void OnWindowDestroying(WmWindow* window) override; |
| 60 |
| 61 // WindowTreeHostManager::Observer override. |
| 62 void OnDisplayConfigurationChanged() override; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(PinnedController); |
| 65 }; |
| 66 |
| 67 } // namespace wm |
| 68 } // namespace ash |
| 69 |
| 70 #endif // ASH_WM_PINNED_CONTROLLER_H_ |
| OLD | NEW |