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

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

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: Address varkha's comments in #7 Created 6 years, 3 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
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 929f687a2d2ddc02ba212d71c4dadc989d0385c3..83d864c58062bfdbadbaac8d9ca31f2632138116 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -416,6 +416,7 @@ DockedWindowLayoutManager::DockedWindowLayoutManager(
WORKSPACE_WINDOW_STATE_FULL_SCREEN),
docked_width_(0),
alignment_(DOCKED_ALIGNMENT_NONE),
+ preferred_alignment_(DOCKED_ALIGNMENT_NONE),
last_active_window_(NULL),
last_action_time_(base::Time::Now()),
background_widget_(new DockedBackgroundWidget(dock_container_)) {
@@ -689,8 +690,10 @@ void DockedWindowLayoutManager::OnWindowAddedToLayout(aura::Window* child) {
// A window can be added without proper bounds when window is moved to another
// display via API or due to display configuration change, so the alignment
// is set based on which edge is closer in the new display.
- if (alignment_ == DOCKED_ALIGNMENT_NONE)
- alignment_ = GetEdgeNearestWindow(child);
+ if (alignment_ == DOCKED_ALIGNMENT_NONE) {
+ alignment_ = preferred_alignment_ != DOCKED_ALIGNMENT_NONE ?
+ preferred_alignment_ : GetEdgeNearestWindow(child);
+ }
MaybeMinimizeChildrenExcept(child);
child->AddObserver(this);
wm::GetWindowState(child)->AddObserver(this);
@@ -851,6 +854,8 @@ void DockedWindowLayoutManager::OnPreWindowStateTypeChange(
MinimizeDockedWindow(window_state);
} else if (old_type == wm::WINDOW_STATE_TYPE_DOCKED_MINIMIZED) {
RestoreDockedWindow(window_state);
+ } else if (old_type == wm::WINDOW_STATE_TYPE_MINIMIZED) {
+ NOTREACHED() << "Minimized window in docked layout manager";
}
}

Powered by Google App Engine
This is Rietveld 408576698