OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
| 6 #define ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
| 7 |
| 8 #include "athena/input/public/accelerator_manager.h" |
| 9 #include "athena/wm/public/window_manager.h" |
| 10 #include "athena/wm/title_drag_controller.h" |
| 11 #include "athena/wm/window_overview_mode.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/observer_list.h" |
| 14 #include "ui/aura/window_observer.h" |
| 15 |
| 16 namespace wm { |
| 17 class ShadowController; |
| 18 class WMState; |
| 19 } |
| 20 |
| 21 namespace athena { |
| 22 |
| 23 class BezelController; |
| 24 class SplitViewController; |
| 25 class WindowListProvider; |
| 26 class WindowManagerObserver; |
| 27 |
| 28 class WindowManagerImpl : public WindowManager, |
| 29 public WindowOverviewModeDelegate, |
| 30 public aura::WindowObserver, |
| 31 public AcceleratorHandler, |
| 32 public TitleDragControllerDelegate { |
| 33 public: |
| 34 WindowManagerImpl(); |
| 35 virtual ~WindowManagerImpl(); |
| 36 |
| 37 void Layout(); |
| 38 |
| 39 // WindowManager: |
| 40 virtual void ToggleOverview() OVERRIDE; |
| 41 virtual bool IsOverviewModeActive() OVERRIDE; |
| 42 |
| 43 private: |
| 44 friend class WindowManagerImplTestApi; |
| 45 |
| 46 enum Command { |
| 47 CMD_TOGGLE_OVERVIEW, |
| 48 }; |
| 49 |
| 50 // Sets whether overview mode is active. |
| 51 void SetInOverview(bool active); |
| 52 |
| 53 void InstallAccelerators(); |
| 54 |
| 55 // WindowManager: |
| 56 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE; |
| 57 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE; |
| 58 |
| 59 // WindowOverviewModeDelegate: |
| 60 virtual void OnSelectWindow(aura::Window* window) OVERRIDE; |
| 61 virtual void OnSplitViewMode(aura::Window* left, |
| 62 aura::Window* right) OVERRIDE; |
| 63 |
| 64 // aura::WindowObserver: |
| 65 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
| 66 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 67 |
| 68 // AcceleratorHandler: |
| 69 virtual bool IsCommandEnabled(int command_id) const OVERRIDE; |
| 70 virtual bool OnAcceleratorFired(int command_id, |
| 71 const ui::Accelerator& accelerator) OVERRIDE; |
| 72 |
| 73 // TitleDragControllerDelegate: |
| 74 virtual aura::Window* GetWindowBehind(aura::Window* window) OVERRIDE; |
| 75 virtual void OnTitleDragStarted(aura::Window* window) OVERRIDE; |
| 76 virtual void OnTitleDragCompleted(aura::Window* window) OVERRIDE; |
| 77 virtual void OnTitleDragCanceled(aura::Window* window) OVERRIDE; |
| 78 |
| 79 scoped_ptr<aura::Window> container_; |
| 80 scoped_ptr<WindowListProvider> window_list_provider_; |
| 81 scoped_ptr<WindowOverviewMode> overview_; |
| 82 scoped_ptr<BezelController> bezel_controller_; |
| 83 scoped_ptr<SplitViewController> split_view_controller_; |
| 84 scoped_ptr<wm::WMState> wm_state_; |
| 85 scoped_ptr<TitleDragController> title_drag_controller_; |
| 86 scoped_ptr<wm::ShadowController> shadow_controller_; |
| 87 ObserverList<WindowManagerObserver> observers_; |
| 88 |
| 89 DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl); |
| 90 }; |
| 91 |
| 92 } // namespace athena |
| 93 |
| 94 #endif // ATHENA_WM_WINDOW_MANAGER_IMPL_H_ |
OLD | NEW |