Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Side by Side Diff: ash/common/wm/dock/docked_window_layout_manager.h

Issue 2036353002: mash: Move ash/common/wm/shelf to ash/common/shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gyp Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/wm/dock/dock_types.h" 11 #include "ash/common/wm/dock/dock_types.h"
12 #include "ash/common/wm/dock/docked_window_layout_manager_observer.h" 12 #include "ash/common/wm/dock/docked_window_layout_manager_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_activation_observer.h" 14 #include "ash/common/wm/wm_activation_observer.h"
15 #include "ash/common/wm/wm_root_window_controller_observer.h" 15 #include "ash/common/wm/wm_root_window_controller_observer.h"
16 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h" 16 #include "ash/common/wm/wm_snap_to_pixel_layout_manager.h"
17 #include "ash/common/wm/wm_window_observer.h" 17 #include "ash/common/wm/wm_window_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 WmShelf;
30 31
31 namespace wm { 32 namespace wm {
32 class WmRootWindowController; 33 class WmRootWindowController;
33 class WmShelf;
34 } 34 }
35 35
36 // DockedWindowLayoutManager is responsible for organizing windows when they are 36 // DockedWindowLayoutManager is responsible for organizing windows when they are
37 // docked to the side of a screen. It is associated with a specific container 37 // docked to the side of a screen. It is associated with a specific container
38 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any 38 // window (i.e. kShellWindowId_DockedContainer) and controls the layout of any
39 // windows added to that container. 39 // windows added to that container.
40 // 40 //
41 // The constructor takes a |dock_container| argument which is expected to set 41 // The constructor takes a |dock_container| argument which is expected to set
42 // its layout manager to this instance, e.g.: 42 // its layout manager to this instance, e.g.:
43 // dock_container->SetLayoutManager( 43 // dock_container->SetLayoutManager(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // Called by a DockedWindowResizer when a window is no longer being dragged. 86 // Called by a DockedWindowResizer when a window is no longer being dragged.
87 // Stops observing the window unless it is a child. 87 // Stops observing the window unless it is a child.
88 // Records |action| by |source| in UMA. 88 // Records |action| by |source| in UMA.
89 void FinishDragging(DockedAction action, DockedActionSource source); 89 void FinishDragging(DockedAction action, DockedActionSource source);
90 90
91 // Checks the rules and possibly updates the docked layout to match 91 // Checks the rules and possibly updates the docked layout to match
92 // the |alignment|. May not apply the |alignment| when 92 // the |alignment|. May not apply the |alignment| when
93 // the current shelf alignment conflicts. Never clears the |alignment_|. 93 // the current shelf alignment conflicts. Never clears the |alignment_|.
94 void MaybeSetDesiredDockedAlignment(DockedAlignment alignment); 94 void MaybeSetDesiredDockedAlignment(DockedAlignment alignment);
95 95
96 wm::WmShelf* shelf() { return shelf_; } 96 WmShelf* shelf() { return shelf_; }
97 void SetShelf(wm::WmShelf* shelf); 97 void SetShelf(WmShelf* shelf);
98 98
99 // Calculates if a window is touching the screen edges and returns edge. 99 // Calculates if a window is touching the screen edges and returns edge.
100 DockedAlignment GetAlignmentOfWindow(const wm::WmWindow* window) const; 100 DockedAlignment GetAlignmentOfWindow(const wm::WmWindow* window) const;
101 101
102 // Used to snap docked windows to the side of screen during drag. 102 // Used to snap docked windows to the side of screen during drag.
103 DockedAlignment CalculateAlignment() const; 103 DockedAlignment CalculateAlignment() const;
104 104
105 void set_preferred_alignment(DockedAlignment preferred_alignment) { 105 void set_preferred_alignment(DockedAlignment preferred_alignment) {
106 preferred_alignment_ = preferred_alignment; 106 preferred_alignment_ = preferred_alignment;
107 } 107 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 261
262 // True if the window being dragged is currently docked. 262 // True if the window being dragged is currently docked.
263 bool is_dragged_window_docked_; 263 bool is_dragged_window_docked_;
264 264
265 // Previously docked windows use a more relaxed dragging sorting algorithm 265 // Previously docked windows use a more relaxed dragging sorting algorithm
266 // that uses assumption that a window starts being dragged out of position 266 // that uses assumption that a window starts being dragged out of position
267 // that was previously established in Relayout. This allows easier reordering. 267 // that was previously established in Relayout. This allows easier reordering.
268 bool is_dragged_from_dock_; 268 bool is_dragged_from_dock_;
269 269
270 // The shelf to respond to alignment changes. 270 // The shelf to respond to alignment changes.
271 wm::WmShelf* shelf_; 271 WmShelf* shelf_;
272 272
273 // Tracks if any window in the same root window is in fullscreen mode. 273 // Tracks if any window in the same root window is in fullscreen mode.
274 bool in_fullscreen_; 274 bool in_fullscreen_;
275 // Current width of the dock. 275 // Current width of the dock.
276 int docked_width_; 276 int docked_width_;
277 277
278 // Last bounds that were sent to observers. 278 // Last bounds that were sent to observers.
279 gfx::Rect docked_bounds_; 279 gfx::Rect docked_bounds_;
280 280
281 // Target bounds of a docked window being dragged. 281 // Target bounds of a docked window being dragged.
(...skipping 24 matching lines...) Expand all
306 306
307 // Observers of dock bounds changes. 307 // Observers of dock bounds changes.
308 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_; 308 base::ObserverList<DockedWindowLayoutManagerObserver> observer_list_;
309 309
310 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); 310 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager);
311 }; 311 };
312 312
313 } // namespace ash 313 } // namespace ash
314 314
315 #endif // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 315 #endif // ASH_COMMON_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698