| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| 6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 6 #define ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| 11 #include "ash/wm/common/wm_activation_observer.h" | 11 #include "ash/wm/common/wm_activation_observer.h" |
| 12 #include "ash/wm/common/wm_root_window_controller_observer.h" | 12 #include "ash/wm/common/wm_root_window_controller_observer.h" |
| 13 #include "ash/wm/common/wm_snap_to_pixel_layout_manager.h" | 13 #include "ash/wm/common/wm_snap_to_pixel_layout_manager.h" |
| 14 #include "ash/wm/common/wm_window_observer.h" | 14 #include "ash/wm/common/wm_window_observer.h" |
| 15 #include "ash/wm/dock/dock_types.h" | 15 #include "ash/wm/dock/dock_types.h" |
| 16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
| 17 #include "ash/wm/window_state_observer.h" | 17 #include "ash/wm/window_state_observer.h" |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| 23 #include "ui/keyboard/keyboard_controller_observer.h" | 23 #include "ui/keyboard/keyboard_controller_observer.h" |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 class DockedBackgroundWidget; | 26 class DockedBackgroundWidget; |
| 27 class DockedWindowLayoutManagerObserver; | 27 class DockedWindowLayoutManagerObserver; |
| 28 class DockedWindowResizerTest; | 28 class DockedWindowResizerTest; |
| 29 class Shelf; | 29 class Shelf; |
| 30 class WorkspaceController; | |
| 31 | 30 |
| 32 namespace wm { | 31 namespace wm { |
| 33 class WmRootWindowController; | 32 class WmRootWindowController; |
| 34 } | 33 } |
| 35 | 34 |
| 36 // DockedWindowLayoutManager is responsible for organizing windows when they are | 35 // DockedWindowLayoutManager is responsible for organizing windows when they are |
| 37 // docked to the side of a screen. It is associated with a specific container | 36 // docked to the side of a screen. It is associated with a specific container |
| 38 // window (i.e. kShellWindowId_DockContainer) and controls the layout of any | 37 // window (i.e. kShellWindowId_DockContainer) and controls the layout of any |
| 39 // windows added to that container. | 38 // windows added to that container. |
| 40 // | 39 // |
| (...skipping 11 matching lines...) Expand all Loading... |
| 52 public wm::WmActivationObserver, | 51 public wm::WmActivationObserver, |
| 53 public keyboard::KeyboardControllerObserver, | 52 public keyboard::KeyboardControllerObserver, |
| 54 public wm::WindowStateObserver { | 53 public wm::WindowStateObserver { |
| 55 public: | 54 public: |
| 56 // Maximum width of the docked windows area. | 55 // Maximum width of the docked windows area. |
| 57 static const int kMaxDockWidth; | 56 static const int kMaxDockWidth; |
| 58 | 57 |
| 59 // Minimum width of the docked windows area. | 58 // Minimum width of the docked windows area. |
| 60 static const int kMinDockWidth; | 59 static const int kMinDockWidth; |
| 61 | 60 |
| 62 DockedWindowLayoutManager(wm::WmWindow* dock_container, | 61 explicit DockedWindowLayoutManager(wm::WmWindow* dock_container); |
| 63 WorkspaceController* workspace_controller); | |
| 64 ~DockedWindowLayoutManager() override; | 62 ~DockedWindowLayoutManager() override; |
| 65 | 63 |
| 66 // Returns the DockedWindowLayoutManager in the specified hierarchy. This | 64 // Returns the DockedWindowLayoutManager in the specified hierarchy. This |
| 67 // searches from the root of |window|. | 65 // searches from the root of |window|. |
| 68 static DockedWindowLayoutManager* Get(wm::WmWindow* window); | 66 static DockedWindowLayoutManager* Get(wm::WmWindow* window); |
| 69 | 67 |
| 70 // Disconnects observers before container windows get destroyed. | 68 // Disconnects observers before container windows get destroyed. |
| 71 void Shutdown(); | 69 void Shutdown(); |
| 72 | 70 |
| 73 // Management of the observer list. | 71 // Management of the observer list. |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 bool is_dragged_window_docked_; | 262 bool is_dragged_window_docked_; |
| 265 | 263 |
| 266 // Previously docked windows use a more relaxed dragging sorting algorithm | 264 // Previously docked windows use a more relaxed dragging sorting algorithm |
| 267 // that uses assumption that a window starts being dragged out of position | 265 // that uses assumption that a window starts being dragged out of position |
| 268 // that was previously established in Relayout. This allows easier reordering. | 266 // that was previously established in Relayout. This allows easier reordering. |
| 269 bool is_dragged_from_dock_; | 267 bool is_dragged_from_dock_; |
| 270 | 268 |
| 271 // The shelf to respond to alignment changes. | 269 // The shelf to respond to alignment changes. |
| 272 Shelf* shelf_; | 270 Shelf* shelf_; |
| 273 | 271 |
| 274 // Workspace controller that can be checked for fullscreen mode. | |
| 275 WorkspaceController* workspace_controller_; | |
| 276 // Tracks if any window in the same root window is in fullscreen mode. | 272 // Tracks if any window in the same root window is in fullscreen mode. |
| 277 bool in_fullscreen_; | 273 bool in_fullscreen_; |
| 278 // Current width of the dock. | 274 // Current width of the dock. |
| 279 int docked_width_; | 275 int docked_width_; |
| 280 | 276 |
| 281 // Last bounds that were sent to observers. | 277 // Last bounds that were sent to observers. |
| 282 gfx::Rect docked_bounds_; | 278 gfx::Rect docked_bounds_; |
| 283 | 279 |
| 284 // Target bounds of a docked window being dragged. | 280 // Target bounds of a docked window being dragged. |
| 285 gfx::Rect dragged_bounds_; | 281 gfx::Rect dragged_bounds_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 309 | 305 |
| 310 // Observers of dock bounds changes. | 306 // Observers of dock bounds changes. |
| 311 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 307 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 312 | 308 |
| 313 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 309 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 314 }; | 310 }; |
| 315 | 311 |
| 316 } // namespace ash | 312 } // namespace ash |
| 317 | 313 |
| 318 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 314 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |