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

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

Issue 594383002: Change behaviour of the Alt-] and Alt-[ keys so that it cycles through SnapLeft/SnapRight to DockLe… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@event
Patch Set: Upload new patch based on dependant change's API name change Created 6 years, 2 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_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 "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/shelf/shelf_layout_manager_observer.h" 9 #include "ash/shelf/shelf_layout_manager_observer.h"
10 #include "ash/shell_observer.h" 10 #include "ash/shell_observer.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 Shelf* shelf() { return shelf_; } 115 Shelf* shelf() { return shelf_; }
116 void SetShelf(Shelf* shelf); 116 void SetShelf(Shelf* shelf);
117 117
118 // Calculates if a window is touching the screen edges and returns edge. 118 // Calculates if a window is touching the screen edges and returns edge.
119 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const; 119 DockedAlignment GetAlignmentOfWindow(const aura::Window* window) const;
120 120
121 // Used to snap docked windows to the side of screen during drag. 121 // Used to snap docked windows to the side of screen during drag.
122 DockedAlignment CalculateAlignment() const; 122 DockedAlignment CalculateAlignment() const;
123 123
124 // Set the preferred alignment of the dock
125 void SetPreferredAlignment(DockedAlignment preferred_alignment);
126
124 // Returns true when a window can be docked. Windows cannot be docked at the 127 // Returns true when a window can be docked. Windows cannot be docked at the
125 // edge used by the shelf or the edge opposite from existing dock. 128 // edge used by the shelf or the edge opposite from existing dock.
126 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); 129 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment);
127 130
128 aura::Window* dock_container() const { return dock_container_; } 131 aura::Window* dock_container() const { return dock_container_; }
129 132
130 // Returns current bounding rectangle of docked windows area. 133 // Returns current bounding rectangle of docked windows area.
131 const gfx::Rect& docked_bounds() const { return docked_bounds_; } 134 const gfx::Rect& docked_bounds() const { return docked_bounds_; }
132 135
133 // Returns last known coordinates of |dragged_window_| after Relayout. 136 // Returns last known coordinates of |dragged_window_| after Relayout.
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 298
296 // Last bounds that were sent to observers. 299 // Last bounds that were sent to observers.
297 gfx::Rect docked_bounds_; 300 gfx::Rect docked_bounds_;
298 301
299 // Target bounds of a docked window being dragged. 302 // Target bounds of a docked window being dragged.
300 gfx::Rect dragged_bounds_; 303 gfx::Rect dragged_bounds_;
301 304
302 // Side of the screen that the dock is positioned at. 305 // Side of the screen that the dock is positioned at.
303 DockedAlignment alignment_; 306 DockedAlignment alignment_;
304 307
308 // The preferred alignment of the next window to be added.
309 DockedAlignment preferred_alignment_;
310
305 // The last active window. Used to maintain stacking order even if no windows 311 // The last active window. Used to maintain stacking order even if no windows
306 // are currently focused. 312 // are currently focused.
307 aura::Window* last_active_window_; 313 aura::Window* last_active_window_;
308 314
309 // Timestamp of the last user-initiated action that changed docked state. 315 // Timestamp of the last user-initiated action that changed docked state.
310 // Used in UMA metrics. 316 // Used in UMA metrics.
311 base::Time last_action_time_; 317 base::Time last_action_time_;
312 318
313 // Observes shelf for bounds changes. 319 // Observes shelf for bounds changes.
314 scoped_ptr<ShelfWindowObserver> shelf_observer_; 320 scoped_ptr<ShelfWindowObserver> shelf_observer_;
315 321
316 // Widget used to paint a background for the docked area. 322 // Widget used to paint a background for the docked area.
317 scoped_ptr<DockedBackgroundWidget> background_widget_; 323 scoped_ptr<DockedBackgroundWidget> background_widget_;
318 324
319 // Observers of dock bounds changes. 325 // Observers of dock bounds changes.
320 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; 326 ObserverList<DockedWindowLayoutManagerObserver> observer_list_;
321 327
322 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); 328 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager);
323 }; 329 };
324 330
325 } // namespace ash 331 } // namespace ash
326 332
327 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 333 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698