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

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: Fix comment 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
« no previous file with comments | « ash/wm/dock/dock_types.h ('k') | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 void set_preferred_alignment(DockedAlignment preferred_alignment) {
125 preferred_alignment_ = preferred_alignment;
126 }
127
128 void set_event_source(DockedActionSource event_source) {
129 event_source_ = event_source;
130 }
131
124 // Returns true when a window can be docked. Windows cannot be docked at the 132 // 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. 133 // edge used by the shelf or the edge opposite from existing dock.
126 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment); 134 bool CanDockWindow(aura::Window* window, DockedAlignment desired_alignment);
127 135
128 aura::Window* dock_container() const { return dock_container_; } 136 aura::Window* dock_container() const { return dock_container_; }
129 137
130 // Returns current bounding rectangle of docked windows area. 138 // Returns current bounding rectangle of docked windows area.
131 const gfx::Rect& docked_bounds() const { return docked_bounds_; } 139 const gfx::Rect& docked_bounds() const { return docked_bounds_; }
132 140
133 // Returns last known coordinates of |dragged_window_| after Relayout. 141 // Returns last known coordinates of |dragged_window_| after Relayout.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 300
293 // Last bounds that were sent to observers. 301 // Last bounds that were sent to observers.
294 gfx::Rect docked_bounds_; 302 gfx::Rect docked_bounds_;
295 303
296 // Target bounds of a docked window being dragged. 304 // Target bounds of a docked window being dragged.
297 gfx::Rect dragged_bounds_; 305 gfx::Rect dragged_bounds_;
298 306
299 // Side of the screen that the dock is positioned at. 307 // Side of the screen that the dock is positioned at.
300 DockedAlignment alignment_; 308 DockedAlignment alignment_;
301 309
310 // The preferred alignment of the next window to be added to docked layout.
311 DockedAlignment preferred_alignment_;
312
313 // The current event source
314 DockedActionSource event_source_;
315
302 // The last active window. Used to maintain stacking order even if no windows 316 // The last active window. Used to maintain stacking order even if no windows
303 // are currently focused. 317 // are currently focused.
304 aura::Window* last_active_window_; 318 aura::Window* last_active_window_;
305 319
306 // Timestamp of the last user-initiated action that changed docked state. 320 // Timestamp of the last user-initiated action that changed docked state.
307 // Used in UMA metrics. 321 // Used in UMA metrics.
308 base::Time last_action_time_; 322 base::Time last_action_time_;
309 323
310 // Observes shelf for bounds changes. 324 // Observes shelf for bounds changes.
311 scoped_ptr<ShelfWindowObserver> shelf_observer_; 325 scoped_ptr<ShelfWindowObserver> shelf_observer_;
312 326
313 // Widget used to paint a background for the docked area. 327 // Widget used to paint a background for the docked area.
314 scoped_ptr<DockedBackgroundWidget> background_widget_; 328 scoped_ptr<DockedBackgroundWidget> background_widget_;
315 329
316 // Observers of dock bounds changes. 330 // Observers of dock bounds changes.
317 ObserverList<DockedWindowLayoutManagerObserver> observer_list_; 331 ObserverList<DockedWindowLayoutManagerObserver> observer_list_;
318 332
319 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager); 333 DISALLOW_COPY_AND_ASSIGN(DockedWindowLayoutManager);
320 }; 334 };
321 335
322 } // namespace ash 336 } // namespace ash
323 337
324 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_ 338 #endif // ASH_WM_DOCK_DOCKED_WINDOW_LAYOUT_MANAGER_H_
OLDNEW
« no previous file with comments | « ash/wm/dock/dock_types.h ('k') | ash/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698