| 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/common/wm/panels/panel_layout_manager.h" | 5 #include "ash/common/wm/panels/panel_layout_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 | 565 |
| 566 void PanelLayoutManager::RestorePanel(WmWindow* panel) { | 566 void PanelLayoutManager::RestorePanel(WmWindow* panel) { |
| 567 PanelList::iterator found = | 567 PanelList::iterator found = |
| 568 std::find(panel_windows_.begin(), panel_windows_.end(), panel); | 568 std::find(panel_windows_.begin(), panel_windows_.end(), panel); |
| 569 DCHECK(found != panel_windows_.end()); | 569 DCHECK(found != panel_windows_.end()); |
| 570 found->slide_in = true; | 570 found->slide_in = true; |
| 571 Relayout(); | 571 Relayout(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 void PanelLayoutManager::Relayout() { | 574 void PanelLayoutManager::Relayout() { |
| 575 if (!shelf_) | 575 if (!shelf_ || !shelf_->GetWindow()) |
| 576 return; | 576 return; |
| 577 | 577 |
| 578 // Suppress layouts during overview mode because changing window bounds | 578 // Suppress layouts during overview mode because changing window bounds |
| 579 // interfered with overview mode animations. However, layouts need to be done | 579 // interfered with overview mode animations. However, layouts need to be done |
| 580 // when the WindowSelectorController is restoring minimized windows so that | 580 // when the WindowSelectorController is restoring minimized windows so that |
| 581 // they actually become visible. | 581 // they actually become visible. |
| 582 WindowSelectorController* window_selector_controller = | 582 WindowSelectorController* window_selector_controller = |
| 583 WmShell::Get()->window_selector_controller(); | 583 WmShell::Get()->window_selector_controller(); |
| 584 if (in_layout_ || | 584 if (in_layout_ || |
| 585 (window_selector_controller->IsSelecting() && | 585 (window_selector_controller->IsSelecting() && |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 // Keyboard hidden, restore original bounds if they exist. | 891 // Keyboard hidden, restore original bounds if they exist. |
| 892 panel->SetBoundsDirect(panel_state->GetRestoreBoundsInScreen()); | 892 panel->SetBoundsDirect(panel_state->GetRestoreBoundsInScreen()); |
| 893 } | 893 } |
| 894 } | 894 } |
| 895 // This bounds change will have caused a change to the Shelf which does not | 895 // This bounds change will have caused a change to the Shelf which does not |
| 896 // propogate automatically to this class, so manually recalculate bounds. | 896 // propogate automatically to this class, so manually recalculate bounds. |
| 897 OnWindowResized(); | 897 OnWindowResized(); |
| 898 } | 898 } |
| 899 | 899 |
| 900 } // namespace ash | 900 } // namespace ash |
| OLD | NEW |