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.
5 #ifndef ATHENA_WM_WINDOW_MANAGER_IMPL_H_
6 #define ATHENA_WM_WINDOW_MANAGER_IMPL_H_
8 #include "athena/athena_export.h"
9 #include "athena/input/public/accelerator_manager.h"
10 #include "athena/wm/public/window_manager.h"
11 #include "athena/wm/title_drag_controller.h"
12 #include "athena/wm/window_overview_mode.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h"
15 #include "ui/aura/window_observer.h"
18 class ShadowController;
25 class WindowManagerImplTestApi;
28 class BezelController;
29 class SplitViewController;
30 class WindowListProvider;
31 class WindowManagerObserver;
33 class ATHENA_EXPORT WindowManagerImpl : public WindowManager,
34 public WindowOverviewModeDelegate,
35 public aura::WindowObserver,
36 public AcceleratorHandler,
37 public TitleDragControllerDelegate {
40 virtual ~WindowManagerImpl();
42 void ToggleSplitView();
45 virtual void ToggleOverview() OVERRIDE;
46 virtual bool IsOverviewModeActive() OVERRIDE;
49 friend class test::WindowManagerImplTestApi;
50 friend class AthenaContainerLayoutManager;
54 CMD_TOGGLE_SPLIT_VIEW,
57 // Sets whether overview mode is active.
58 void SetInOverview(bool active);
60 void InstallAccelerators();
63 virtual void AddObserver(WindowManagerObserver* observer) OVERRIDE;
64 virtual void RemoveObserver(WindowManagerObserver* observer) OVERRIDE;
65 virtual void ToggleSplitViewForTest() OVERRIDE;
66 virtual WindowListProvider* GetWindowListProvider() OVERRIDE;
68 // WindowOverviewModeDelegate:
69 virtual void OnSelectWindow(aura::Window* window) OVERRIDE;
70 virtual void OnSelectSplitViewWindow(aura::Window* left,
72 aura::Window* to_activate) OVERRIDE;
74 // aura::WindowObserver:
75 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
77 // AcceleratorHandler:
78 virtual bool IsCommandEnabled(int command_id) const OVERRIDE;
79 virtual bool OnAcceleratorFired(int command_id,
80 const ui::Accelerator& accelerator) OVERRIDE;
82 // TitleDragControllerDelegate:
83 virtual aura::Window* GetWindowBehind(aura::Window* window) OVERRIDE;
84 virtual void OnTitleDragStarted(aura::Window* window) OVERRIDE;
85 virtual void OnTitleDragCompleted(aura::Window* window) OVERRIDE;
86 virtual void OnTitleDragCanceled(aura::Window* window) OVERRIDE;
88 scoped_ptr<aura::Window> container_;
89 scoped_ptr<WindowListProvider> window_list_provider_;
90 scoped_ptr<WindowOverviewMode> overview_;
91 scoped_ptr<BezelController> bezel_controller_;
92 scoped_ptr<SplitViewController> split_view_controller_;
93 scoped_ptr<wm::WMState> wm_state_;
94 scoped_ptr<TitleDragController> title_drag_controller_;
95 scoped_ptr<wm::ShadowController> shadow_controller_;
96 ObserverList<WindowManagerObserver> observers_;
98 DISALLOW_COPY_AND_ASSIGN(WindowManagerImpl);
101 } // namespace athena
103 #endif // ATHENA_WM_WINDOW_MANAGER_IMPL_H_