| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ash/wm/panels/panel_layout_manager.h" | 5 #include "ash/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 601 |
| 602 // Consider the dragged panel as part of the layout as long as it is | 602 // Consider the dragged panel as part of the layout as long as it is |
| 603 // touching the shelf. | 603 // touching the shelf. |
| 604 if (!panel->IsVisible() || | 604 if (!panel->IsVisible() || |
| 605 (panel == dragged_panel_ && | 605 (panel == dragged_panel_ && |
| 606 !BoundsAdjacent(panel->bounds(), shelf_bounds))) { | 606 !BoundsAdjacent(panel->bounds(), shelf_bounds))) { |
| 607 continue; | 607 continue; |
| 608 } | 608 } |
| 609 | 609 |
| 610 // If the shelf is currently hidden (full-screen mode), minimize panel until | 610 // If the shelf is currently hidden (full-screen mode), minimize panel until |
| 611 // full-screen mode is exited. | 611 // full-screen mode is exited. When a panel is dragged from another display |
| 612 if (restore_windows_on_shelf_visible_) { | 612 // the shelf state does not update before the panel is added so we exclude |
| 613 // the dragged panel. |
| 614 if (panel != dragged_panel_ && restore_windows_on_shelf_visible_) { |
| 613 wm::GetWindowState(panel)->Minimize(); | 615 wm::GetWindowState(panel)->Minimize(); |
| 614 restore_windows_on_shelf_visible_->Add(panel); | 616 restore_windows_on_shelf_visible_->Add(panel); |
| 615 continue; | 617 continue; |
| 616 } | 618 } |
| 617 | 619 |
| 618 gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); | 620 gfx::Rect icon_bounds = shelf_->GetScreenBoundsOfItemIconForWindow(panel); |
| 619 | 621 |
| 620 // If both the icon width and height are 0 then there is no icon in the | 622 // If both the icon width and height are 0 then there is no icon in the |
| 621 // shelf. If the shelf is hidden, one of the height or width will be | 623 // shelf. If the shelf is hidden, one of the height or width will be |
| 622 // 0 but the position in the shelf and major dimension is still reported | 624 // 0 but the position in the shelf and major dimension is still reported |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 | 886 |
| 885 void PanelLayoutManager::OnKeyboardBoundsChanging( | 887 void PanelLayoutManager::OnKeyboardBoundsChanging( |
| 886 const gfx::Rect& keyboard_bounds) { | 888 const gfx::Rect& keyboard_bounds) { |
| 887 // This bounds change will have caused a change to the Shelf which does not | 889 // This bounds change will have caused a change to the Shelf which does not |
| 888 // propogate automatically to this class, so manually recalculate bounds. | 890 // propogate automatically to this class, so manually recalculate bounds. |
| 889 OnWindowResized(); | 891 OnWindowResized(); |
| 890 } | 892 } |
| 891 | 893 |
| 892 } // namespace internal | 894 } // namespace internal |
| 893 } // namespace ash | 895 } // namespace ash |
| OLD | NEW |