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 ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ash/shell_observer.h" | 12 #include "ash/shell_observer.h" |
13 #include "ash/wm/window_state.h" | 13 #include "ash/wm/window_state.h" |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "ui/aura/window_observer.h" | 16 #include "ui/aura/window_observer.h" |
17 #include "ui/events/event_handler.h" | 17 #include "ui/events/event_handler.h" |
18 #include "ui/gfx/display_observer.h" | 18 #include "ui/gfx/display_observer.h" |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 class TouchEvent; | 21 class TouchEvent; |
22 } | 22 } |
23 | 23 |
24 namespace ash { | 24 namespace ash { |
| 25 class MaximizeModeController; |
25 class MaximizeModeWindowState; | 26 class MaximizeModeWindowState; |
26 class Shell; | |
27 | 27 |
28 // A window manager which - when created - will force all windows into maximized | 28 // A window manager which - when created - will force all windows into maximized |
29 // mode. Exception are panels and windows which cannot be maximized. | 29 // mode. Exception are panels and windows which cannot be maximized. |
30 // Windows which cannot be maximized / resized are centered with a layer placed | 30 // Windows which cannot be maximized / resized are centered with a layer placed |
31 // behind the window so that no other windows are visible and/or obscured. | 31 // behind the window so that no other windows are visible and/or obscured. |
32 // With the destruction of the manager all windows will be restored to their | 32 // With the destruction of the manager all windows will be restored to their |
33 // original state. | 33 // original state. |
34 class ASH_EXPORT MaximizeModeWindowManager : public aura::WindowObserver, | 34 class ASH_EXPORT MaximizeModeWindowManager : public aura::WindowObserver, |
35 public gfx::DisplayObserver, | 35 public gfx::DisplayObserver, |
36 public ShellObserver, | 36 public ShellObserver, |
(...skipping 22 matching lines...) Expand all Loading... |
59 // gfx::DisplayObserver overrides: | 59 // gfx::DisplayObserver overrides: |
60 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; | 60 virtual void OnDisplayAdded(const gfx::Display& display) OVERRIDE; |
61 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; | 61 virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE; |
62 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 62 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
63 uint32_t metrics) OVERRIDE; | 63 uint32_t metrics) OVERRIDE; |
64 | 64 |
65 // ui::EventHandler override: | 65 // ui::EventHandler override: |
66 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; | 66 virtual void OnTouchEvent(ui::TouchEvent* event) OVERRIDE; |
67 | 67 |
68 protected: | 68 protected: |
69 friend class ash::Shell; | 69 friend class MaximizeModeController; |
70 | 70 |
71 // The object should only be created by the ash::Shell. | 71 // The object should only be created by the ash::Shell. |
72 MaximizeModeWindowManager(); | 72 MaximizeModeWindowManager(); |
73 | 73 |
74 private: | 74 private: |
75 typedef std::map<aura::Window*, MaximizeModeWindowState*> WindowToState; | 75 typedef std::map<aura::Window*, MaximizeModeWindowState*> WindowToState; |
76 | 76 |
77 // Maximize all windows and restore their current state. | 77 // Maximize all windows and restore their current state. |
78 void MaximizeAllWindows(); | 78 void MaximizeAllWindows(); |
79 | 79 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 // True if all backdrops are hidden. | 118 // True if all backdrops are hidden. |
119 bool backdrops_hidden_; | 119 bool backdrops_hidden_; |
120 | 120 |
121 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManager); | 121 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManager); |
122 }; | 122 }; |
123 | 123 |
124 } // namespace ash | 124 } // namespace ash |
125 | 125 |
126 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 126 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
OLD | NEW |