| 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_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 5 #ifndef ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| 6 #define ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 6 #define ASH_COMMON_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/common/shell_observer.h" | 11 #include "ash/common/shell_observer.h" |
| 12 #include "ash/common/wm/dock/dock_types.h" | 12 #include "ash/common/wm/dock/dock_types.h" |
| 13 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" | 13 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" |
| 14 #include "ash/common/wm/window_state_observer.h" | 14 #include "ash/common/wm/window_state_observer.h" |
| 15 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" | 15 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 19 #include "base/scoped_observer.h" |
| 19 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 20 #include "ui/aura/window_observer.h" | 21 #include "ui/aura/window_observer.h" |
| 21 #include "ui/display/display_observer.h" | 22 #include "ui/display/display_observer.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
| 23 #include "ui/keyboard/keyboard_controller_observer.h" | 24 #include "ui/keyboard/keyboard_controller_observer.h" |
| 24 #include "ui/wm/public/activation_change_observer.h" | 25 #include "ui/wm/public/activation_change_observer.h" |
| 25 | 26 |
| 27 namespace keyboard { |
| 28 class KeyboardController; |
| 29 } |
| 30 |
| 26 namespace ash { | 31 namespace ash { |
| 27 class DockedBackgroundWidget; | 32 class DockedBackgroundWidget; |
| 28 class DockedWindowLayoutManagerObserver; | 33 class DockedWindowLayoutManagerObserver; |
| 29 class DockedWindowResizerTest; | 34 class DockedWindowResizerTest; |
| 30 class RootWindowController; | 35 class RootWindowController; |
| 31 class WmShelf; | 36 class WmShelf; |
| 32 | 37 |
| 33 // DockedWindowLayoutManager is responsible for organizing windows when they are | 38 // DockedWindowLayoutManager is responsible for organizing windows when they are |
| 34 // docked to the side of a screen. It is associated with a specific container | 39 // docked to the side of a screen. It is associated with a specific container |
| 35 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any | 40 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 124 |
| 120 // Returns last known coordinates of |dragged_window_| after Relayout. | 125 // Returns last known coordinates of |dragged_window_| after Relayout. |
| 121 const gfx::Rect dragged_bounds() const { return dragged_bounds_; } | 126 const gfx::Rect dragged_bounds() const { return dragged_bounds_; } |
| 122 | 127 |
| 123 // Returns true if currently dragged window is docked at the screen edge. | 128 // Returns true if currently dragged window is docked at the screen edge. |
| 124 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } | 129 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } |
| 125 | 130 |
| 126 // Updates docked layout when shelf bounds change. | 131 // Updates docked layout when shelf bounds change. |
| 127 void OnShelfBoundsChanged(); | 132 void OnShelfBoundsChanged(); |
| 128 | 133 |
| 134 void StartObservingKeyboard( |
| 135 keyboard::KeyboardController* keyboard_controller); |
| 136 void StopObservingKeyboard(keyboard::KeyboardController* keyboard_controller); |
| 137 |
| 129 // SnapLayoutManager: | 138 // SnapLayoutManager: |
| 130 void OnWindowResized() override; | 139 void OnWindowResized() override; |
| 131 void OnWindowAddedToLayout(WmWindow* child) override; | 140 void OnWindowAddedToLayout(WmWindow* child) override; |
| 132 void OnWillRemoveWindowFromLayout(WmWindow* child) override {} | 141 void OnWillRemoveWindowFromLayout(WmWindow* child) override {} |
| 133 void OnWindowRemovedFromLayout(WmWindow* child) override; | 142 void OnWindowRemovedFromLayout(WmWindow* child) override; |
| 134 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; | 143 void OnChildWindowVisibilityChanged(WmWindow* child, bool visibile) override; |
| 135 void SetChildBounds(WmWindow* child, | 144 void SetChildBounds(WmWindow* child, |
| 136 const gfx::Rect& requested_bounds) override; | 145 const gfx::Rect& requested_bounds) override; |
| 137 | 146 |
| 138 // display::DisplayObserver: | 147 // display::DisplayObserver: |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 | 317 |
| 309 // Observes shelf for bounds changes. | 318 // Observes shelf for bounds changes. |
| 310 std::unique_ptr<ShelfWindowObserver> shelf_observer_; | 319 std::unique_ptr<ShelfWindowObserver> shelf_observer_; |
| 311 | 320 |
| 312 // Widget used to paint a background for the docked area. | 321 // Widget used to paint a background for the docked area. |
| 313 std::unique_ptr<DockedBackgroundWidget> background_widget_; | 322 std::unique_ptr<DockedBackgroundWidget> background_widget_; |
| 314 | 323 |
| 315 // Observers of dock bounds changes. | 324 // Observers of dock bounds changes. |
| 316 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 325 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 317 | 326 |
| 327 ScopedObserver<keyboard::KeyboardController, |
| 328 keyboard::KeyboardControllerObserver> |
| 329 keyboard_observer_; |
| 330 |
| 318 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 331 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 319 }; | 332 }; |
| 320 | 333 |
| 321 } // namespace ash | 334 } // namespace ash |
| 322 | 335 |
| 323 #endif // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 336 #endif // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |