Chromium Code Reviews| 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 91fe6c83ab798a45f4560b725463bf5d9ffe2bfe..d416d5d67cef690bcde8616626968319e4519227 100644 |
| --- a/ash/wm/dock/docked_window_layout_manager.cc |
| +++ b/ash/wm/dock/docked_window_layout_manager.cc |
| @@ -210,8 +210,8 @@ bool IsPopupOrTransient(const aura::Window* window) { |
| ::wm::GetTransientParent(window)); |
| } |
| -// Certain windows (minimized, hidden or popups) do not matter to docking. |
| -bool IsUsedByLayout(const aura::Window* window) { |
| +// Certain windows (minimized, hidden or popups) are ignored by layout logic. |
| +bool IsIgnoredForDocking(const aura::Window* window) { |
|
oshima
2015/06/05 23:08:36
This is still confusing to me.
If this is to indi
varkha
2015/06/07 02:53:24
Done. You are right, haven't noticed that I had re
|
| return (window->IsVisible() && |
| !wm::GetWindowState(window)->IsMinimized() && |
| !IsPopupOrTransient(window)); |
| @@ -479,8 +479,7 @@ void DockedWindowLayoutManager::StartDragging(aura::Window* window) { |
| WindowResizer::kBoundsChangeDirection_Horizontal)) { |
| for (size_t i = 0; i < dock_container_->children().size(); ++i) { |
| aura::Window* window1(dock_container_->children()[i]); |
| - if (IsUsedByLayout(window1) && |
| - window1 != dragged_window_ && |
| + if (IsIgnoredForDocking(window1) && window1 != dragged_window_ && |
| window1->bounds().width() == docked_width_) { |
| wm::GetWindowState(window1)->set_bounds_changed_by_user(false); |
| } |
| @@ -745,6 +744,8 @@ void DockedWindowLayoutManager::SetChildBounds( |
| actual_new_bounds.set_height( |
| std::max(min_size.height(), actual_new_bounds.height())); |
| } |
| + if (IsIgnoredForDocking(child) && child != dragged_window_) |
| + return; |
| SnapToPixelLayoutManager::SetChildBounds(child, actual_new_bounds); |
| if (IsPopupOrTransient(child)) |
| return; |
| @@ -936,7 +937,7 @@ void DockedWindowLayoutManager::MaybeMinimizeChildrenExcept( |
| aura::Window::Windows::const_reverse_iterator iter = children.rbegin(); |
| while (iter != children.rend()) { |
| aura::Window* window(*iter++); |
| - if (window == child || !IsUsedByLayout(window)) |
| + if (window == child || !IsIgnoredForDocking(window)) |
| continue; |
| int room_needed = GetWindowHeightCloseTo(window, 0) + |
| (gap_needed ? kMinDockGap : 0); |
| @@ -1013,7 +1014,7 @@ void DockedWindowLayoutManager::RecordUmaAction(DockedAction action, |
| if (IsPopupOrTransient(window)) |
| continue; |
| docked_all_count++; |
| - if (!IsUsedByLayout(window)) |
| + if (!IsIgnoredForDocking(window)) |
| continue; |
| docked_visible_count++; |
| if (window->type() == ui::wm::WINDOW_TYPE_PANEL) |
| @@ -1074,7 +1075,7 @@ void DockedWindowLayoutManager::Relayout() { |
| for (size_t i = 0; i < dock_container_->children().size(); ++i) { |
| aura::Window* window(dock_container_->children()[i]); |
| - if (!IsUsedByLayout(window) || window == dragged_window_) |
| + if (!IsIgnoredForDocking(window) || window == dragged_window_) |
| continue; |
| // If the shelf is currently hidden (full-screen mode), hide window until |
| @@ -1314,7 +1315,7 @@ void DockedWindowLayoutManager::UpdateStacking(aura::Window* active_window) { |
| for (aura::Window::Windows::const_iterator it = |
| dock_container_->children().begin(); |
| it != dock_container_->children().end(); ++it) { |
| - if (!IsUsedByLayout(*it) || |
| + if (!IsIgnoredForDocking(*it) || |
| ((*it) == dragged_window_ && !is_dragged_window_docked_)) { |
| continue; |
| } |