| 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 { | 
| + | 
| +// Handles pinned state. | 
| +class PinnedController : public ShellObserver, | 
| +                         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; | 
| +  // 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. | 
| +  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. | 
| +  void OnDisplayConfigurationChanged() override; | 
| + | 
| +  DISALLOW_COPY_AND_ASSIGN(PinnedController); | 
| +}; | 
| + | 
| +}  // namespace wm | 
| +}  // namespace ash | 
| + | 
| +#endif  // ASH_WM_PINNED_CONTROLLER_H_ | 
|  |