Index: ash/wm/pinned_controller.h |
diff --git a/ash/wm/pinned_controller.h b/ash/wm/pinned_controller.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6c4d3e1ce7ebcebcf4c1a640506b2e73acf3a2b3 |
--- /dev/null |
+++ b/ash/wm/pinned_controller.h |
@@ -0,0 +1,70 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_WM_PINNED_CONTROLLER_H_ |
+#define ASH_WM_PINNED_CONTROLLER_H_ |
+ |
+#include <vector> |
+ |
+#include "ash/common/shell_observer.h" |
+#include "ash/common/wm_window_observer.h" |
+#include "ash/display/window_tree_host_manager.h" |
+#include "base/macros.h" |
+ |
+namespace ash { |
+ |
+class WmWindow; |
+ |
+namespace wm { |
oshima
2016/06/17 10:26:54
Let's keep it just ash. I know it's not consistent
hidehiko
2016/06/17 17:19:22
Done.
|
+ |
+// Handles pinned state. |
+class PinnedController : public ShellObserver, |
oshima
2016/06/17 10:26:54
ScreenPinningController would be better because it
hidehiko
2016/06/17 17:19:22
Done.
|
+ public WmWindowObserver, |
+ public WindowTreeHostManager::Observer { |
+ public: |
+ PinnedController(); |
+ ~PinnedController() override; |
+ |
+ // Returns true if in pinned mode, otherwise false. |
+ bool IsPinned() const; |
+ |
+ private: |
+ // Pinned window should be on top in the parent window. |
+ WmWindow* pinned_window_ = nullptr; |
oshima
2016/06/17 10:26:54
new line. same for below.
hidehiko
2016/06/17 17:19:22
Done.
|
+ // Dim background window just behind of the pinned window. |
+ // Not owned. The parent has its ownership. |
+ WmWindow* background_window_ = nullptr; |
+ // In pinned mode, all displays other than the one where pinned_window_ is. |
+ // Similar to background_window_, not owned. |
+ std::vector<WmWindow*> dim_windows_; |
+ // Set true only when restacking done by this controller. |
+ bool in_restacking_ = false; |
+ |
+ // Keeps the pinned window on top of the siblings. |
+ void KeepPinnedWindowOnTop(); |
+ |
+ // Keeps the dim window on top of the container. |
+ void KeepDimWindowOnTop(WmWindow* container); |
+ |
+ // ShellObserver override. |
+ void OnPinnedStateChanged(WmWindow* pinned_window) override; |
+ |
+ // WmWindowObserver override. |
oshima
2016/06/17 10:26:54
nit: // WmWindowObserver:
hidehiko
2016/06/17 17:19:22
Acknowledged.
|
+ void OnWindowTreeChanging(WmWindow* window, |
+ const TreeChangeParams& params) override; |
+ void OnWindowTreeChanged(WmWindow* window, |
+ const TreeChangeParams& params) override; |
+ void OnWindowStackingChanged(WmWindow* window) override; |
+ void OnWindowDestroying(WmWindow* window) override; |
+ |
+ // WindowTreeHostManager::Observer override. |
oshima
2016/06/17 10:26:54
// WindowTreeHostManager::Observer:
hidehiko
2016/06/17 17:19:22
Done.
|
+ void OnDisplayConfigurationChanged() override; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(PinnedController); |
+}; |
+ |
+} // namespace wm |
+} // namespace ash |
+ |
+#endif // ASH_WM_PINNED_CONTROLLER_H_ |