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

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 263083005: Remove "Alternate frame caption button style" command line flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.h ('k') | ash/wm/workspace/phantom_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index daddd1f419c8c261868cf28cd99c71f666460990..ab738eab79503d271274c304bef8d033d8ebb6c9 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -590,8 +590,9 @@ DockedAlignment DockedWindowLayoutManager::CalculateAlignment() const {
return DOCKED_ALIGNMENT_NONE;
}
-bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
- SnapType edge) {
+bool DockedWindowLayoutManager::CanDockWindow(
+ aura::Window* window,
+ DockedAlignment desired_alignment) {
if (!switches::UseDockedWindows())
return false;
// Don't allow interactive docking of windows with transient parents such as
@@ -622,16 +623,19 @@ bool DockedWindowLayoutManager::CanDockWindow(aura::Window* window,
return false;
// Cannot dock on the other size from an existing dock.
const DockedAlignment alignment = CalculateAlignment();
- if ((edge == SNAP_LEFT && alignment == DOCKED_ALIGNMENT_RIGHT) ||
- (edge == SNAP_RIGHT && alignment == DOCKED_ALIGNMENT_LEFT)) {
+ if (desired_alignment != DOCKED_ALIGNMENT_NONE &&
+ alignment != DOCKED_ALIGNMENT_NONE &&
+ alignment != desired_alignment) {
return false;
}
// Do not allow docking on the same side as shelf.
ShelfAlignment shelf_alignment = SHELF_ALIGNMENT_BOTTOM;
if (shelf_)
shelf_alignment = shelf_->alignment();
- if ((edge == SNAP_LEFT && shelf_alignment == SHELF_ALIGNMENT_LEFT) ||
- (edge == SNAP_RIGHT && shelf_alignment == SHELF_ALIGNMENT_RIGHT)) {
+ if ((desired_alignment == DOCKED_ALIGNMENT_LEFT &&
+ shelf_alignment == SHELF_ALIGNMENT_LEFT) ||
+ (desired_alignment == DOCKED_ALIGNMENT_RIGHT &&
+ shelf_alignment == SHELF_ALIGNMENT_RIGHT)) {
return false;
}
return true;
@@ -943,7 +947,7 @@ void DockedWindowLayoutManager::RestoreDockedWindow(
const gfx::Rect work_area = display.work_area();
// Evict the window if it can no longer be docked because of its height.
- if (!CanDockWindow(window, SNAP_NONE)) {
+ if (!CanDockWindow(window, DOCKED_ALIGNMENT_NONE)) {
UndockWindow(window);
RecordUmaAction(DOCKED_ACTION_EVICT, DOCKED_ACTION_SOURCE_UNKNOWN);
return;
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager.h ('k') | ash/wm/workspace/phantom_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698