| 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/shell_observer.h" | 11 #include "ash/shell_observer.h" |
| 12 #include "ash/snap_to_pixel_layout_manager.h" | 12 #include "ash/wm/common/wm_activation_observer.h" |
| 13 #include "ash/wm/common/wm_snap_to_pixel_layout_manager.h" |
| 14 #include "ash/wm/common/wm_window_observer.h" |
| 13 #include "ash/wm/dock/dock_types.h" | 15 #include "ash/wm/dock/dock_types.h" |
| 14 #include "ash/wm/dock/docked_window_layout_manager_observer.h" | 16 #include "ash/wm/dock/docked_window_layout_manager_observer.h" |
| 15 #include "ash/wm/window_state_observer.h" | 17 #include "ash/wm/window_state_observer.h" |
| 16 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 19 #include "base/macros.h" |
| 18 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 19 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 20 #include "ui/aura/window.h" | |
| 21 #include "ui/aura/window_observer.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 #include "ui/wm/public/activation_change_observer.h" | |
| 25 | 24 |
| 26 namespace aura { | 25 namespace aura { |
| 27 class Window; | 26 class Window; |
| 28 } | 27 } |
| 29 | 28 |
| 30 namespace gfx { | 29 namespace gfx { |
| 31 class Point; | 30 class Point; |
| 32 } | 31 } |
| 33 | 32 |
| 34 namespace views { | 33 namespace views { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 // windows added to that container. | 47 // windows added to that container. |
| 49 // | 48 // |
| 50 // The constructor takes a |dock_container| argument which is expected to set | 49 // The constructor takes a |dock_container| argument which is expected to set |
| 51 // its layout manager to this instance, e.g.: | 50 // its layout manager to this instance, e.g.: |
| 52 // dock_container->SetLayoutManager( | 51 // dock_container->SetLayoutManager( |
| 53 // new DockedWindowLayoutManager(dock_container)); | 52 // new DockedWindowLayoutManager(dock_container)); |
| 54 // | 53 // |
| 55 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit | 54 // TODO(varkha): extend BaseLayoutManager instead of LayoutManager to inherit |
| 56 // common functionality. | 55 // common functionality. |
| 57 class ASH_EXPORT DockedWindowLayoutManager | 56 class ASH_EXPORT DockedWindowLayoutManager |
| 58 : public SnapToPixelLayoutManager, | 57 : public wm::WmSnapToPixelLayoutManager, |
| 59 public ash::ShellObserver, | 58 public ash::ShellObserver, |
| 60 public aura::WindowObserver, | 59 public wm::WmWindowObserver, |
| 61 public aura::client::ActivationChangeObserver, | 60 public wm::WmActivationObserver, |
| 62 public keyboard::KeyboardControllerObserver, | 61 public keyboard::KeyboardControllerObserver, |
| 63 public wm::WindowStateObserver { | 62 public wm::WindowStateObserver { |
| 64 public: | 63 public: |
| 65 // Maximum width of the docked windows area. | 64 // Maximum width of the docked windows area. |
| 66 static const int kMaxDockWidth; | 65 static const int kMaxDockWidth; |
| 67 | 66 |
| 68 // Minimum width of the docked windows area. | 67 // Minimum width of the docked windows area. |
| 69 static const int kMinDockWidth; | 68 static const int kMinDockWidth; |
| 70 | 69 |
| 71 DockedWindowLayoutManager(aura::Window* dock_container, | 70 DockedWindowLayoutManager(wm::WmWindow* dock_container, |
| 72 WorkspaceController* workspace_controller); | 71 WorkspaceController* workspace_controller); |
| 73 ~DockedWindowLayoutManager() override; | 72 ~DockedWindowLayoutManager() override; |
| 74 | 73 |
| 74 // Returns the DockedWindowLayoutManager in the specified hierarchy. This |
| 75 // searches from the root of |window|. |
| 76 static DockedWindowLayoutManager* Get(wm::WmWindow* window); |
| 77 |
| 75 // Disconnects observers before container windows get destroyed. | 78 // Disconnects observers before container windows get destroyed. |
| 76 void Shutdown(); | 79 void Shutdown(); |
| 77 | 80 |
| 78 // Management of the observer list. | 81 // Management of the observer list. |
| 79 virtual void AddObserver(DockedWindowLayoutManagerObserver* observer); | 82 virtual void AddObserver(DockedWindowLayoutManagerObserver* observer); |
| 80 virtual void RemoveObserver(DockedWindowLayoutManagerObserver* observer); | 83 virtual void RemoveObserver(DockedWindowLayoutManagerObserver* observer); |
| 81 | 84 |
| 82 // Called by a DockedWindowResizer to update which window is being dragged. | 85 // Called by a DockedWindowResizer to update which window is being dragged. |
| 83 // Starts observing the window unless it is a child. | 86 // Starts observing the window unless it is a child. |
| 84 void StartDragging(aura::Window* window); | 87 void StartDragging(wm::WmWindow* window); |
| 85 | 88 |
| 86 // Called by a DockedWindowResizer when a dragged window is docked. | 89 // Called by a DockedWindowResizer when a dragged window is docked. |
| 87 void DockDraggedWindow(aura::Window* window); | 90 void DockDraggedWindow(wm::WmWindow* window); |
| 88 | 91 |
| 89 // Called by a DockedWindowResizer when a dragged window is no longer docked. | 92 // Called by a DockedWindowResizer when a dragged window is no longer docked. |
| 90 void UndockDraggedWindow(); | 93 void UndockDraggedWindow(); |
| 91 | 94 |
| 92 // Called by a DockedWindowResizer when a window is no longer being dragged. | 95 // Called by a DockedWindowResizer when a window is no longer being dragged. |
| 93 // Stops observing the window unless it is a child. | 96 // Stops observing the window unless it is a child. |
| 94 // Records |action| by |source| in UMA. | 97 // Records |action| by |source| in UMA. |
| 95 void FinishDragging(DockedAction action, DockedActionSource source); | 98 void FinishDragging(DockedAction action, DockedActionSource source); |
| 96 | 99 |
| 97 // Checks the rules and possibly updates the docked layout to match | 100 // Checks the rules and possibly updates the docked layout to match |
| 98 // the |alignment|. May not apply the |alignment| when | 101 // the |alignment|. May not apply the |alignment| when |
| 99 // the current shelf alignment conflicts. Never clears the |alignment_|. | 102 // the current shelf alignment conflicts. Never clears the |alignment_|. |
| 100 void MaybeSetDesiredDockedAlignment(DockedAlignment alignment); | 103 void MaybeSetDesiredDockedAlignment(DockedAlignment alignment); |
| 101 | 104 |
| 102 Shelf* shelf() { return shelf_; } | 105 Shelf* shelf() { return shelf_; } |
| 103 void SetShelf(Shelf* shelf); | 106 void SetShelf(Shelf* shelf); |
| 104 | 107 |
| 105 // Calculates if a window is touching the screen edges and returns edge. | 108 // Calculates if a window is touching the screen edges and returns edge. |
| 106 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; | 109 DockedAlignment GetAlignmentOfWindow(const wm::WmWindow* window) const; |
| 107 | 110 |
| 108 // Used to snap docked windows to the side of screen during drag. | 111 // Used to snap docked windows to the side of screen during drag. |
| 109 DockedAlignment CalculateAlignment() const; | 112 DockedAlignment CalculateAlignment() const; |
| 110 | 113 |
| 111 void set_preferred_alignment(DockedAlignment preferred_alignment) { | 114 void set_preferred_alignment(DockedAlignment preferred_alignment) { |
| 112 preferred_alignment_ = preferred_alignment; | 115 preferred_alignment_ = preferred_alignment; |
| 113 } | 116 } |
| 114 | 117 |
| 115 void set_event_source(DockedActionSource event_source) { | 118 void set_event_source(DockedActionSource event_source) { |
| 116 event_source_ = event_source; | 119 event_source_ = event_source; |
| 117 } | 120 } |
| 118 | 121 |
| 119 // Returns true when a window can be docked. Windows cannot be docked at the | 122 // Returns true when a window can be docked. Windows cannot be docked at the |
| 120 // edge used by the shelf or the edge opposite from existing dock. | 123 // edge used by the shelf or the edge opposite from existing dock. |
| 121 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); | 124 bool CanDockWindow(wm::WmWindow* window, DockedAlignment desired_alignment); |
| 122 | 125 |
| 123 aura::Window* dock_container() const { return dock_container_; } | 126 wm::WmWindow* dock_container() const { return dock_container_; } |
| 124 | 127 |
| 125 // Returns current bounding rectangle of docked windows area. | 128 // Returns current bounding rectangle of docked windows area. |
| 126 const gfx::Rect& docked_bounds() const { return docked_bounds_; } | 129 const gfx::Rect& docked_bounds() const { return docked_bounds_; } |
| 127 | 130 |
| 128 // Returns last known coordinates of |dragged_window_| after Relayout. | 131 // Returns last known coordinates of |dragged_window_| after Relayout. |
| 129 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} | 132 const gfx::Rect dragged_bounds() const { return dragged_bounds_;} |
| 130 | 133 |
| 131 // Returns true if currently dragged window is docked at the screen edge. | 134 // Returns true if currently dragged window is docked at the screen edge. |
| 132 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } | 135 bool is_dragged_window_docked() const { return is_dragged_window_docked_; } |
| 133 | 136 |
| 134 // Updates docked layout when shelf bounds change. | 137 // Updates docked layout when shelf bounds change. |
| 135 void OnShelfBoundsChanged(); | 138 void OnShelfBoundsChanged(); |
| 136 | 139 |
| 137 // SnapLayoutManager: | 140 // SnapLayoutManager: |
| 138 void OnWindowResized() override; | 141 void OnWindowResized() override; |
| 139 void OnWindowAddedToLayout(aura::Window* child) override; | 142 void OnWindowAddedToLayout(wm::WmWindow* child) override; |
| 140 void OnWillRemoveWindowFromLayout(aura::Window* child) override {} | 143 void OnWillRemoveWindowFromLayout(wm::WmWindow* child) override {} |
| 141 void OnWindowRemovedFromLayout(aura::Window* child) override; | 144 void OnWindowRemovedFromLayout(wm::WmWindow* child) override; |
| 142 void OnChildWindowVisibilityChanged(aura::Window* child, | 145 void OnChildWindowVisibilityChanged(wm::WmWindow* child, |
| 143 bool visibile) override; | 146 bool visibile) override; |
| 144 void SetChildBounds(aura::Window* child, | 147 void SetChildBounds(wm::WmWindow* child, |
| 145 const gfx::Rect& requested_bounds) override; | 148 const gfx::Rect& requested_bounds) override; |
| 146 | 149 |
| 147 // ash::ShellObserver: | 150 // ash::ShellObserver: |
| 148 void OnDisplayWorkAreaInsetsChanged() override; | 151 void OnDisplayWorkAreaInsetsChanged() override; |
| 149 void OnFullscreenStateChanged(bool is_fullscreen, | 152 void OnFullscreenStateChanged(bool is_fullscreen, |
| 150 aura::Window* root_window) override; | 153 aura::Window* root_window) override; |
| 151 void OnShelfAlignmentChanged(aura::Window* root_window) override; | 154 void OnShelfAlignmentChanged(aura::Window* root_window) override; |
| 152 | 155 |
| 153 // wm::WindowStateObserver: | 156 // wm::WindowStateObserver: |
| 154 void OnPreWindowStateTypeChange(wm::WindowState* window_state, | 157 void OnPreWindowStateTypeChange(wm::WindowState* window_state, |
| 155 wm::WindowStateType old_type) override; | 158 wm::WindowStateType old_type) override; |
| 156 | 159 |
| 157 // aura::WindowObserver: | 160 // wm::WmWindowObserver: |
| 158 void OnWindowBoundsChanged(aura::Window* window, | 161 void OnWindowBoundsChanged(wm::WmWindow* window, |
| 159 const gfx::Rect& old_bounds, | 162 const gfx::Rect& old_bounds, |
| 160 const gfx::Rect& new_bounds) override; | 163 const gfx::Rect& new_bounds) override; |
| 161 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; | 164 void OnWindowVisibilityChanging(wm::WmWindow* window, bool visible) override; |
| 162 void OnWindowDestroying(aura::Window* window) override; | 165 void OnWindowDestroying(wm::WmWindow* window) override; |
| 163 | 166 |
| 164 // aura::client::ActivationChangeObserver: | 167 // wm::WmActivationObserver: |
| 165 void OnWindowActivated( | 168 void OnWindowActivated(wm::WmWindow* gained_active, |
| 166 aura::client::ActivationChangeObserver::ActivationReason reason, | 169 wm::WmWindow* lost_active) override; |
| 167 aura::Window* gained_active, | |
| 168 aura::Window* lost_active) override; | |
| 169 | 170 |
| 170 private: | 171 private: |
| 171 struct CompareMinimumHeight; | 172 struct CompareMinimumHeight; |
| 172 struct CompareWindowPos; | 173 struct CompareWindowPos; |
| 173 class ShelfWindowObserver; | 174 class ShelfWindowObserver; |
| 174 struct WindowWithHeight; | 175 struct WindowWithHeight; |
| 175 | 176 |
| 176 friend class DockedWindowLayoutManagerTest; | 177 friend class DockedWindowLayoutManagerTest; |
| 177 friend class DockedWindowResizerTest; | 178 friend class DockedWindowResizerTest; |
| 178 | 179 |
| 179 // Width of the gap between the docked windows and a workspace. | 180 // Width of the gap between the docked windows and a workspace. |
| 180 static const int kMinDockGap; | 181 static const int kMinDockGap; |
| 181 | 182 |
| 182 // Ideal (starting) width of the dock. | 183 // Ideal (starting) width of the dock. |
| 183 static const int kIdealWidth; | 184 static const int kIdealWidth; |
| 184 | 185 |
| 185 // Returns the alignment of the docked windows other than the |child|. | 186 // Returns the alignment of the docked windows other than the |child|. |
| 186 DockedAlignment CalculateAlignmentExcept(const aura::Window* child) const; | 187 DockedAlignment CalculateAlignmentExcept(const wm::WmWindow* child) const; |
| 187 | 188 |
| 188 // Determines if the |alignment| is applicable taking into account | 189 // Determines if the |alignment| is applicable taking into account |
| 189 // the shelf alignment. | 190 // the shelf alignment. |
| 190 bool IsDockedAlignmentValid(DockedAlignment alignment) const; | 191 bool IsDockedAlignmentValid(DockedAlignment alignment) const; |
| 191 | 192 |
| 192 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest | 193 // Keep at most kMaxVisibleWindows visible in the dock and minimize the rest |
| 193 // (except for |child|). | 194 // (except for |child|). |
| 194 void MaybeMinimizeChildrenExcept(aura::Window* child); | 195 void MaybeMinimizeChildrenExcept(wm::WmWindow* child); |
| 195 | 196 |
| 196 // Minimize / restore window and relayout. | 197 // Minimize / restore window and relayout. |
| 197 void MinimizeDockedWindow(wm::WindowState* window_state); | 198 void MinimizeDockedWindow(wm::WindowState* window_state); |
| 198 void RestoreDockedWindow(wm::WindowState* window_state); | 199 void RestoreDockedWindow(wm::WindowState* window_state); |
| 199 | 200 |
| 200 // Record user-initiated |action| by |source| in UMA metrics. | 201 // Record user-initiated |action| by |source| in UMA metrics. |
| 201 void RecordUmaAction(DockedAction action, DockedActionSource source); | 202 void RecordUmaAction(DockedAction action, DockedActionSource source); |
| 202 | 203 |
| 203 // Updates |docked_width_| and UMA histograms. | 204 // Updates |docked_width_| and UMA histograms. |
| 204 void UpdateDockedWidth(int width); | 205 void UpdateDockedWidth(int width); |
| 205 | 206 |
| 206 // Updates docked layout state when a window gets inside the dock. | 207 // Updates docked layout state when a window gets inside the dock. |
| 207 void OnDraggedWindowDocked(aura::Window* window); | 208 void OnDraggedWindowDocked(wm::WmWindow* window); |
| 208 | 209 |
| 209 // Updates docked layout state when a window gets outside the dock. | 210 // Updates docked layout state when a window gets outside the dock. |
| 210 void OnDraggedWindowUndocked(); | 211 void OnDraggedWindowUndocked(); |
| 211 | 212 |
| 212 // Returns true if there are any windows currently docked. | 213 // Returns true if there are any windows currently docked. |
| 213 bool IsAnyWindowDocked(); | 214 bool IsAnyWindowDocked(); |
| 214 | 215 |
| 215 // Returns DOCKED_ALIGNMENT_LEFT if the |window|'s left edge is closer to | 216 // Returns DOCKED_ALIGNMENT_LEFT if the |window|'s left edge is closer to |
| 216 // the |dock_container_|'s left edge than the |window|'s right edge to | 217 // the |dock_container_|'s left edge than the |window|'s right edge to |
| 217 // the |dock_container_|'s right edge. Returns DOCKED_ALIGNMENT_RIGHT | 218 // the |dock_container_|'s right edge. Returns DOCKED_ALIGNMENT_RIGHT |
| 218 // otherwise. | 219 // otherwise. |
| 219 DockedAlignment GetEdgeNearestWindow(const aura::Window* window) const; | 220 DockedAlignment GetEdgeNearestWindow(const wm::WmWindow* window) const; |
| 220 | 221 |
| 221 // Called whenever the window layout might change. | 222 // Called whenever the window layout might change. |
| 222 void Relayout(); | 223 void Relayout(); |
| 223 | 224 |
| 224 // Calculates target heights (and fills it in |visible_windows| array) such | 225 // Calculates target heights (and fills it in |visible_windows| array) such |
| 225 // that the vertical space is fairly distributed among the windows taking | 226 // that the vertical space is fairly distributed among the windows taking |
| 226 // into account their minimum and maximum size. Returns free vertical space | 227 // into account their minimum and maximum size. Returns free vertical space |
| 227 // (positive value) that remains after resizing all windows or deficit | 228 // (positive value) that remains after resizing all windows or deficit |
| 228 // (negative value) if not all the windows fit. | 229 // (negative value) if not all the windows fit. |
| 229 int CalculateWindowHeightsAndRemainingRoom( | 230 int CalculateWindowHeightsAndRemainingRoom( |
| 230 const gfx::Rect work_area, | 231 const gfx::Rect& work_area, |
| 231 std::vector<WindowWithHeight>* visible_windows); | 232 std::vector<WindowWithHeight>* visible_windows); |
| 232 | 233 |
| 233 // Calculate ideal width for the docked area. It will get used to adjust the | 234 // Calculate ideal width for the docked area. It will get used to adjust the |
| 234 // dragged window or other windows as necessary. | 235 // dragged window or other windows as necessary. |
| 235 int CalculateIdealWidth(const std::vector<WindowWithHeight>& visible_windows); | 236 int CalculateIdealWidth(const std::vector<WindowWithHeight>& visible_windows); |
| 236 | 237 |
| 237 // Fan out windows evenly distributing the overlap or remaining free space. | 238 // Fan out windows evenly distributing the overlap or remaining free space. |
| 238 // Adjust the widths of the windows trying to make them all same. If this | 239 // Adjust the widths of the windows trying to make them all same. If this |
| 239 // is not possible, center the windows in the docked area. | 240 // is not possible, center the windows in the docked area. |
| 240 void FanOutChildren(const gfx::Rect& work_area, | 241 void FanOutChildren(const gfx::Rect& work_area, |
| 241 int ideal_docked_width, | 242 int ideal_docked_width, |
| 242 int available_room, | 243 int available_room, |
| 243 std::vector<WindowWithHeight>* visible_windows); | 244 std::vector<WindowWithHeight>* visible_windows); |
| 244 | 245 |
| 245 // Updates |docked_bounds_| and workspace insets when bounds of docked windows | 246 // Updates |docked_bounds_| and workspace insets when bounds of docked windows |
| 246 // area change. Passing |reason| to observers allows selectively skipping | 247 // area change. Passing |reason| to observers allows selectively skipping |
| 247 // notifications. | 248 // notifications. |
| 248 void UpdateDockBounds(DockedWindowLayoutManagerObserver::Reason reason); | 249 void UpdateDockBounds(DockedWindowLayoutManagerObserver::Reason reason); |
| 249 | 250 |
| 250 // Called whenever the window stacking order needs to be updated (e.g. focus | 251 // Called whenever the window stacking order needs to be updated (e.g. focus |
| 251 // changes or a window is moved). | 252 // changes or a window is moved). |
| 252 void UpdateStacking(aura::Window* active_window); | 253 void UpdateStacking(wm::WmWindow* active_window); |
| 253 | 254 |
| 254 // keyboard::KeyboardControllerObserver: | 255 // keyboard::KeyboardControllerObserver: |
| 255 void OnKeyboardBoundsChanging(const gfx::Rect& keyboard_bounds) override; | 256 void OnKeyboardBoundsChanging(const gfx::Rect& keyboard_bounds) override; |
| 256 | 257 |
| 257 // Parent window associated with this layout manager. | 258 // Parent window associated with this layout manager. |
| 258 aura::Window* dock_container_; | 259 wm::WmWindow* dock_container_; |
| 259 // Protect against recursive calls to Relayout(). | 260 // Protect against recursive calls to Relayout(). |
| 260 bool in_layout_; | 261 bool in_layout_; |
| 261 | 262 |
| 262 // A window that is being dragged (whether docked or not). | 263 // A window that is being dragged (whether docked or not). |
| 263 // Windows are tracked by docked layout manager only if they are docked; | 264 // Windows are tracked by docked layout manager only if they are docked; |
| 264 // however we need to know if a window is being dragged in order to avoid | 265 // however we need to know if a window is being dragged in order to avoid |
| 265 // positioning it or even considering it for layout. | 266 // positioning it or even considering it for layout. |
| 266 aura::Window* dragged_window_; | 267 wm::WmWindow* dragged_window_; |
| 267 | 268 |
| 268 // True if the window being dragged is currently docked. | 269 // True if the window being dragged is currently docked. |
| 269 bool is_dragged_window_docked_; | 270 bool is_dragged_window_docked_; |
| 270 | 271 |
| 271 // Previously docked windows use a more relaxed dragging sorting algorithm | 272 // Previously docked windows use a more relaxed dragging sorting algorithm |
| 272 // that uses assumption that a window starts being dragged out of position | 273 // that uses assumption that a window starts being dragged out of position |
| 273 // that was previously established in Relayout. This allows easier reordering. | 274 // that was previously established in Relayout. This allows easier reordering. |
| 274 bool is_dragged_from_dock_; | 275 bool is_dragged_from_dock_; |
| 275 | 276 |
| 276 // The shelf to respond to alignment changes. | 277 // The shelf to respond to alignment changes. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 293 DockedAlignment alignment_; | 294 DockedAlignment alignment_; |
| 294 | 295 |
| 295 // The preferred alignment of the next window to be added to docked layout. | 296 // The preferred alignment of the next window to be added to docked layout. |
| 296 DockedAlignment preferred_alignment_; | 297 DockedAlignment preferred_alignment_; |
| 297 | 298 |
| 298 // The current event source | 299 // The current event source |
| 299 DockedActionSource event_source_; | 300 DockedActionSource event_source_; |
| 300 | 301 |
| 301 // The last active window. Used to maintain stacking order even if no windows | 302 // The last active window. Used to maintain stacking order even if no windows |
| 302 // are currently focused. | 303 // are currently focused. |
| 303 aura::Window* last_active_window_; | 304 wm::WmWindow* last_active_window_; |
| 304 | 305 |
| 305 // Timestamp of the last user-initiated action that changed docked state. | 306 // Timestamp of the last user-initiated action that changed docked state. |
| 306 // Used in UMA metrics. | 307 // Used in UMA metrics. |
| 307 base::Time last_action_time_; | 308 base::Time last_action_time_; |
| 308 | 309 |
| 309 // Observes shelf for bounds changes. | 310 // Observes shelf for bounds changes. |
| 310 std::unique_ptr<ShelfWindowObserver> shelf_observer_; | 311 std::unique_ptr<ShelfWindowObserver> shelf_observer_; |
| 311 | 312 |
| 312 // Widget used to paint a background for the docked area. | 313 // Widget used to paint a background for the docked area. |
| 313 std::unique_ptr<DockedBackgroundWidget> background_widget_; | 314 std::unique_ptr<DockedBackgroundWidget> background_widget_; |
| 314 | 315 |
| 315 // Observers of dock bounds changes. | 316 // Observers of dock bounds changes. |
| 316 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; | 317 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; |
| 317 | 318 |
| 318 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); | 319 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); |
| 319 }; | 320 }; |
| 320 | 321 |
| 321 } // namespace ash | 322 } // namespace ash |
| 322 | 323 |
| 323 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ | 324 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ |
| OLD | NEW |