| 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_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 5 #ifndef ASH_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
| 6 #define ASH_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 6 #define ASH_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> | 11 #include <unordered_set> |
| 12 | 12 |
| 13 #include "ash/ash_export.h" | 13 #include "ash/ash_export.h" |
| 14 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
| 15 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
| 16 #include "ash/common/wm_window_observer.h" | 16 #include "ash/common/wm_window_observer.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "ui/display/display_observer.h" | 18 #include "ui/display/display_observer.h" |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 class MaximizeModeController; | 21 class MaximizeModeController; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 // Overridden from WindowObserver: | 57 // Overridden from WindowObserver: |
| 58 void OnWindowDestroying(WmWindow* window) override; | 58 void OnWindowDestroying(WmWindow* window) override; |
| 59 void OnWindowTreeChanged(WmWindow* window, | 59 void OnWindowTreeChanged(WmWindow* window, |
| 60 const TreeChangeParams& params) override; | 60 const TreeChangeParams& params) override; |
| 61 void OnWindowPropertyChanged(WmWindow* window, | 61 void OnWindowPropertyChanged(WmWindow* window, |
| 62 WmWindowProperty window_property) override; | 62 WmWindowProperty window_property) override; |
| 63 void OnWindowBoundsChanged(WmWindow* window, | 63 void OnWindowBoundsChanged(WmWindow* window, |
| 64 const gfx::Rect& old_bounds, | 64 const gfx::Rect& old_bounds, |
| 65 const gfx::Rect& new_bounds) override; | 65 const gfx::Rect& new_bounds) override; |
| 66 void OnWindowVisibilityChanging(WmWindow* window, bool visible) override; |
| 66 | 67 |
| 67 // display::DisplayObserver overrides: | 68 // display::DisplayObserver overrides: |
| 68 void OnDisplayAdded(const display::Display& display) override; | 69 void OnDisplayAdded(const display::Display& display) override; |
| 69 void OnDisplayRemoved(const display::Display& display) override; | 70 void OnDisplayRemoved(const display::Display& display) override; |
| 70 void OnDisplayMetricsChanged(const display::Display& display, | 71 void OnDisplayMetricsChanged(const display::Display& display, |
| 71 uint32_t metrics) override; | 72 uint32_t metrics) override; |
| 72 | 73 |
| 73 protected: | 74 protected: |
| 74 friend class MaximizeModeController; | 75 friend class MaximizeModeController; |
| 75 | 76 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Returns true when the |window| is a container window. | 116 // Returns true when the |window| is a container window. |
| 116 bool IsContainerWindow(WmWindow* window); | 117 bool IsContainerWindow(WmWindow* window); |
| 117 | 118 |
| 118 // Add a backdrop behind the currently active window on each desktop. | 119 // Add a backdrop behind the currently active window on each desktop. |
| 119 void EnableBackdropBehindTopWindowOnEachDisplay(bool enable); | 120 void EnableBackdropBehindTopWindowOnEachDisplay(bool enable); |
| 120 | 121 |
| 121 // Every window which got touched by our window manager gets added here. | 122 // Every window which got touched by our window manager gets added here. |
| 122 WindowToState window_state_map_; | 123 WindowToState window_state_map_; |
| 123 | 124 |
| 124 // All container windows which have to be tracked. | 125 // All container windows which have to be tracked. |
| 125 std::set<WmWindow*> observed_container_windows_; | 126 std::unordered_set<WmWindow*> observed_container_windows_; |
| 127 |
| 128 // Windows added to the container, but not yet shown. |
| 129 std::unordered_set<WmWindow*> added_windows_; |
| 126 | 130 |
| 127 // True if all backdrops are hidden. | 131 // True if all backdrops are hidden. |
| 128 bool backdrops_hidden_; | 132 bool backdrops_hidden_; |
| 129 | 133 |
| 130 std::unique_ptr<wm::MaximizeModeEventHandler> event_handler_; | 134 std::unique_ptr<wm::MaximizeModeEventHandler> event_handler_; |
| 131 | 135 |
| 132 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManager); | 136 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowManager); |
| 133 }; | 137 }; |
| 134 | 138 |
| 135 } // namespace ash | 139 } // namespace ash |
| 136 | 140 |
| 137 #endif // ASH_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ | 141 #endif // ASH_COMMON_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_MANAGER_H_ |
| OLD | NEW |