| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| 6 #define ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 6 #define ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
| 12 #include "ash/common/shell_observer.h" | 12 #include "ash/common/shell_observer.h" |
| 13 #include "ash/common/wm/window_state_observer.h" | 13 #include "ash/common/wm/window_state_observer.h" |
| 14 #include "ash/common/wm/wm_types.h" | 14 #include "ash/common/wm/wm_types.h" |
| 15 #include "ash/common/wm_activation_observer.h" | 15 #include "ash/common/wm_activation_observer.h" |
| 16 #include "ash/common/wm_layout_manager.h" | 16 #include "ash/common/wm_layout_manager.h" |
| 17 #include "ash/common/wm_window_observer.h" | |
| 18 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "ui/aura/window_observer.h" |
| 19 #include "ui/display/display_observer.h" | 19 #include "ui/display/display_observer.h" |
| 20 #include "ui/gfx/geometry/rect.h" | 20 #include "ui/gfx/geometry/rect.h" |
| 21 #include "ui/keyboard/keyboard_controller_observer.h" | 21 #include "ui/keyboard/keyboard_controller_observer.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 |
| 24 class RootWindowController; | 25 class RootWindowController; |
| 25 class WmShell; | 26 class WmShell; |
| 27 class WmWindow; |
| 26 class WorkspaceLayoutManagerBackdropDelegate; | 28 class WorkspaceLayoutManagerBackdropDelegate; |
| 27 | 29 |
| 28 namespace wm { | 30 namespace wm { |
| 29 class WMEvent; | 31 class WMEvent; |
| 30 } | 32 } |
| 31 | 33 |
| 32 // LayoutManager used on the window created for a workspace. | 34 // LayoutManager used on the window created for a workspace. |
| 33 class ASH_EXPORT WorkspaceLayoutManager | 35 class ASH_EXPORT WorkspaceLayoutManager |
| 34 : public WmLayoutManager, | 36 : public WmLayoutManager, |
| 35 public WmWindowObserver, | 37 public aura::WindowObserver, |
| 36 public WmActivationObserver, | 38 public WmActivationObserver, |
| 37 public keyboard::KeyboardControllerObserver, | 39 public keyboard::KeyboardControllerObserver, |
| 38 public display::DisplayObserver, | 40 public display::DisplayObserver, |
| 39 public ShellObserver, | 41 public ShellObserver, |
| 40 public wm::WindowStateObserver { | 42 public wm::WindowStateObserver { |
| 41 public: | 43 public: |
| 42 // |window| is the container for this layout manager. | 44 // |window| is the container for this layout manager. |
| 43 explicit WorkspaceLayoutManager(WmWindow* window); | 45 explicit WorkspaceLayoutManager(WmWindow* window); |
| 44 ~WorkspaceLayoutManager() override; | 46 ~WorkspaceLayoutManager() override; |
| 45 | 47 |
| 46 // A delegate which can be set to add a backdrop behind the top most visible | 48 // A delegate which can be set to add a backdrop behind the top most visible |
| 47 // window. With the call the ownership of the delegate will be transferred to | 49 // window. With the call the ownership of the delegate will be transferred to |
| 48 // the WorkspaceLayoutManager. | 50 // the WorkspaceLayoutManager. |
| 49 void SetMaximizeBackdropDelegate( | 51 void SetMaximizeBackdropDelegate( |
| 50 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); | 52 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> delegate); |
| 51 | 53 |
| 52 // Overridden from WmLayoutManager: | 54 // Overridden from WmLayoutManager: |
| 53 void OnWindowResized() override; | 55 void OnWindowResized() override; |
| 54 void OnWindowAddedToLayout(WmWindow* child) override; | 56 void OnWindowAddedToLayout(WmWindow* child) override; |
| 55 void OnWillRemoveWindowFromLayout(WmWindow* child) override; | 57 void OnWillRemoveWindowFromLayout(WmWindow* child) override; |
| 56 void OnWindowRemovedFromLayout(WmWindow* child) override; | 58 void OnWindowRemovedFromLayout(WmWindow* child) override; |
| 57 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; | 59 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; |
| 58 void SetChildBounds(WmWindow* child, | 60 void SetChildBounds(WmWindow* child, |
| 59 const gfx::Rect& requested_bounds) override; | 61 const gfx::Rect& requested_bounds) override; |
| 60 | 62 |
| 61 // Overriden from WmWindowObserver: | 63 // Overriden from aura::WindowObserver: |
| 62 void OnWindowTreeChanged( | 64 void OnWindowHierarchyChanged(const HierarchyChangeParams& params) override; |
| 63 WmWindow* window, | 65 void OnWindowPropertyChanged(aura::Window* window, |
| 64 const WmWindowObserver::TreeChangeParams& params) override; | 66 const void* key, |
| 65 void OnWindowPropertyChanged(WmWindow* window, | 67 intptr_t old) override; |
| 66 WmWindowProperty property) override; | 68 void OnWindowStackingChanged(aura::Window* window) override; |
| 67 void OnWindowStackingChanged(WmWindow* window) override; | 69 void OnWindowDestroying(aura::Window* window) override; |
| 68 void OnWindowDestroying(WmWindow* window) override; | 70 void OnWindowBoundsChanged(aura::Window* window, |
| 69 void OnWindowBoundsChanged(WmWindow* window, | |
| 70 const gfx::Rect& old_bounds, | 71 const gfx::Rect& old_bounds, |
| 71 const gfx::Rect& new_bounds) override; | 72 const gfx::Rect& new_bounds) override; |
| 72 | 73 |
| 73 // WmActivationObserver overrides: | 74 // WmActivationObserver overrides: |
| 74 void OnWindowActivated(WmWindow* gained_active, | 75 void OnWindowActivated(WmWindow* gained_active, |
| 75 WmWindow* lost_active) override; | 76 WmWindow* lost_active) override; |
| 76 | 77 |
| 77 // keyboard::KeyboardControllerObserver overrides: | 78 // keyboard::KeyboardControllerObserver overrides: |
| 78 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 79 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
| 79 void OnKeyboardClosed() override; | 80 void OnKeyboardClosed() override; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // A window which covers the full container and which gets inserted behind the | 132 // A window which covers the full container and which gets inserted behind the |
| 132 // topmost visible window. | 133 // topmost visible window. |
| 133 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop_delegate_; | 134 std::unique_ptr<WorkspaceLayoutManagerBackdropDelegate> backdrop_delegate_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); | 136 DISALLOW_COPY_AND_ASSIGN(WorkspaceLayoutManager); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace ash | 139 } // namespace ash |
| 139 | 140 |
| 140 #endif // ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ | 141 #endif // ASH_COMMON_WM_WORKSPACE_WORKSPACE_LAYOUT_MANAGER_H_ |
| OLD | NEW |