| 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 9eb4a12a986353d1fcce26060c6eee2e7981059d..f1879cc658c24de81b2ffc296fbbae621442760b 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_)) {
|
| @@ -637,7 +638,7 @@ bool DockedWindowLayoutManager::CanDockWindow(
|
|
|
| bool DockedWindowLayoutManager::IsDockedAlignmentValid(
|
| DockedAlignment alignment) const {
|
| - ShelfAlignment shelf_alignment = shelf_ ? shelf->alignment() :
|
| + ShelfAlignment shelf_alignment = shelf_ ? shelf_->alignment() :
|
| SHELF_ALIGNMENT_BOTTOM;
|
| if ((alignment == DOCKED_ALIGNMENT_LEFT &&
|
| shelf_alignment == SHELF_ALIGNMENT_LEFT) ||
|
| @@ -692,8 +693,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);
|
| @@ -854,6 +857,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";
|
| }
|
| }
|
|
|
|
|