| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ATHENA_WM_WINDOW_MANAGER_IMPL_H_ | 5 #ifndef ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
| 6 #define ATHENA_WM_WINDOW_MANAGER_IMPL_H_ | 6 #define ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include "athena/athena_export.h" | 8 #include "athena/athena_export.h" |
| 9 #include "athena/input/public/accelerator_manager.h" | 9 #include "athena/input/public/accelerator_manager.h" |
| 10 #include "athena/wm/public/window_manager.h" | 10 #include "athena/wm/public/window_manager.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class WindowListProviderImpl; | 30 class WindowListProviderImpl; |
| 31 class WindowManagerObserver; | 31 class WindowManagerObserver; |
| 32 | 32 |
| 33 class ATHENA_EXPORT WindowManagerImpl : public WindowManager, | 33 class ATHENA_EXPORT WindowManagerImpl : public WindowManager, |
| 34 public WindowOverviewModeDelegate, | 34 public WindowOverviewModeDelegate, |
| 35 public aura::WindowObserver, | 35 public aura::WindowObserver, |
| 36 public AcceleratorHandler, | 36 public AcceleratorHandler, |
| 37 public TitleDragControllerDelegate { | 37 public TitleDragControllerDelegate { |
| 38 public: | 38 public: |
| 39 WindowManagerImpl(); | 39 WindowManagerImpl(); |
| 40 virtual ~WindowManagerImpl(); | 40 ~WindowManagerImpl() override; |
| 41 | 41 |
| 42 void ToggleSplitView(); | 42 void ToggleSplitView(); |
| 43 | 43 |
| 44 // WindowManager: | 44 // WindowManager: |
| 45 virtual void EnterOverview() override; | 45 void EnterOverview() override; |
| 46 // Exits overview and activates the previously active activity | 46 // Exits overview and activates the previously active activity |
| 47 virtual void ExitOverview() override; | 47 void ExitOverview() override; |
| 48 virtual bool IsOverviewModeActive() override; | 48 bool IsOverviewModeActive() override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 friend class test::WindowManagerImplTestApi; | 51 friend class test::WindowManagerImplTestApi; |
| 52 friend class AthenaContainerLayoutManager; | 52 friend class AthenaContainerLayoutManager; |
| 53 | 53 |
| 54 enum Command { | 54 enum Command { |
| 55 CMD_EXIT_OVERVIEW, | 55 CMD_EXIT_OVERVIEW, |
| 56 CMD_TOGGLE_OVERVIEW, | 56 CMD_TOGGLE_OVERVIEW, |
| 57 CMD_TOGGLE_SPLIT_VIEW, | 57 CMD_TOGGLE_SPLIT_VIEW, |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 const AcceleratorData kEscAcceleratorData = {TRIGGER_ON_PRESS, | 60 const AcceleratorData kEscAcceleratorData = {TRIGGER_ON_PRESS, |
| 61 ui::VKEY_ESCAPE, | 61 ui::VKEY_ESCAPE, |
| 62 ui::EF_NONE, | 62 ui::EF_NONE, |
| 63 CMD_EXIT_OVERVIEW, | 63 CMD_EXIT_OVERVIEW, |
| 64 AF_NONE}; | 64 AF_NONE}; |
| 65 | 65 |
| 66 // Exits overview mode without changing activation. The caller should | 66 // Exits overview mode without changing activation. The caller should |
| 67 // ensure that a window is active after exiting overview mode. | 67 // ensure that a window is active after exiting overview mode. |
| 68 void ExitOverviewNoActivate(); | 68 void ExitOverviewNoActivate(); |
| 69 | 69 |
| 70 void InstallAccelerators(); | 70 void InstallAccelerators(); |
| 71 | 71 |
| 72 // WindowManager: | 72 // WindowManager: |
| 73 virtual void AddObserver(WindowManagerObserver* observer) override; | 73 void AddObserver(WindowManagerObserver* observer) override; |
| 74 virtual void RemoveObserver(WindowManagerObserver* observer) override; | 74 void RemoveObserver(WindowManagerObserver* observer) override; |
| 75 virtual void ToggleSplitViewForTest() override; | 75 void ToggleSplitViewForTest() override; |
| 76 virtual WindowListProvider* GetWindowListProvider() override; | 76 WindowListProvider* GetWindowListProvider() override; |
| 77 | 77 |
| 78 // WindowOverviewModeDelegate: | 78 // WindowOverviewModeDelegate: |
| 79 virtual void OnSelectWindow(aura::Window* window) override; | 79 void OnSelectWindow(aura::Window* window) override; |
| 80 virtual void OnSelectSplitViewWindow(aura::Window* left, | 80 void OnSelectSplitViewWindow(aura::Window* left, |
| 81 aura::Window* right, | 81 aura::Window* right, |
| 82 aura::Window* to_activate) override; | 82 aura::Window* to_activate) override; |
| 83 | 83 |
| 84 // aura::WindowObserver: | 84 // aura::WindowObserver: |
| 85 virtual void OnWindowDestroying(aura::Window* window) override; | 85 void OnWindowDestroying(aura::Window* window) override; |
| 86 | 86 |
| 87 // AcceleratorHandler: | 87 // AcceleratorHandler: |
| 88 virtual bool IsCommandEnabled(int command_id) const override; | 88 bool IsCommandEnabled(int command_id) const override; |
| 89 virtual bool OnAcceleratorFired(int command_id, | 89 bool OnAcceleratorFired(int command_id, |
| 90 const ui::Accelerator& accelerator) override; | 90 const ui::Accelerator& accelerator) override; |
| 91 | 91 |
| 92 // TitleDragControllerDelegate: | 92 // TitleDragControllerDelegate: |
| 93 virtual aura::Window* GetWindowBehind(aura::Window* window) override; | 93 aura::Window* GetWindowBehind(aura::Window* window) override; |
| 94 virtual void OnTitleDragStarted(aura::Window* window) override; | 94 void OnTitleDragStarted(aura::Window* window) override; |
| 95 virtual void OnTitleDragCompleted(aura::Window* window) override; | 95 void OnTitleDragCompleted(aura::Window* window) override; |
| 96 virtual void OnTitleDragCanceled(aura::Window* window) override; | 96 void OnTitleDragCanceled(aura::Window* window) override; |
| 97 | 97 |
| 98 scoped_ptr<aura::Window> container_; | 98 scoped_ptr<aura::Window> container_; |
| 99 scoped_ptr<WindowListProviderImpl> window_list_provider_; | 99 scoped_ptr<WindowListProviderImpl> window_list_provider_; |
| 100 scoped_ptr<WindowOverviewMode> overview_; | 100 scoped_ptr<WindowOverviewMode> overview_; |
| 101 scoped_ptr<BezelController> bezel_controller_; | 101 scoped_ptr<BezelController> bezel_controller_; |
| 102 scoped_ptr<SplitViewController> split_view_controller_; | 102 scoped_ptr<SplitViewController> split_view_controller_; |
| 103 scoped_ptr<wm::WMState> wm_state_; | 103 scoped_ptr<wm::WMState> wm_state_; |
| 104 scoped_ptr<TitleDragController> title_drag_controller_; | 104 scoped_ptr<TitleDragController> title_drag_controller_; |
| 105 scoped_ptr<wm::ShadowController> shadow_controller_; | 105 scoped_ptr<wm::ShadowController> shadow_controller_; |
| 106 ObserverList<WindowManagerObserver> observers_; | 106 ObserverList<WindowManagerObserver> observers_; |
| 107 | 107 |
| 108 DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl); | 108 DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl); |
| 109 }; | 109 }; |
| 110 | 110 |
| 111 } // namespace athena | 111 } // namespace athena |
| 112 | 112 |
| 113 #endif // ATHENA_WM_WINDOW_MANAGER_IMPL_H_ | 113 #endif // ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
| OLD | NEW |