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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 RestorePanel(*iter); | 544 RestorePanel(*iter); |
545 } | 545 } |
546 } | 546 } |
547 return; | 547 return; |
548 } | 548 } |
549 | 549 |
550 if (restore_windows_on_shelf_visible_) | 550 if (restore_windows_on_shelf_visible_) |
551 return; | 551 return; |
552 scoped_ptr<aura::WindowTracker> minimized_windows(new aura::WindowTracker); | 552 scoped_ptr<aura::WindowTracker> minimized_windows(new aura::WindowTracker); |
553 for (PanelList::iterator iter = panel_windows_.begin(); | 553 for (PanelList::iterator iter = panel_windows_.begin(); |
554 iter != panel_windows_.end(); ++iter) { | 554 iter != panel_windows_.end();) { |
555 if (iter->window->IsVisible()) { | 555 aura::Window* window = iter->window; |
556 minimized_windows->Add(iter->window); | 556 // Minimizing a panel window may remove it from the panel_windows_ list. |
557 wm::GetWindowState(iter->window)->Minimize(); | 557 // Advance the iterator before minimizing it: http://crbug.com/393047. |
| 558 ++iter; |
| 559 if (window != dragged_panel_ && window->IsVisible()) { |
| 560 minimized_windows->Add(window); |
| 561 wm::GetWindowState(window)->Minimize(); |
558 } | 562 } |
559 } | 563 } |
560 restore_windows_on_shelf_visible_ = minimized_windows.Pass(); | 564 restore_windows_on_shelf_visible_ = minimized_windows.Pass(); |
561 } | 565 } |
562 | 566 |
563 //////////////////////////////////////////////////////////////////////////////// | 567 //////////////////////////////////////////////////////////////////////////////// |
564 // PanelLayoutManager private implementation: | 568 // PanelLayoutManager private implementation: |
565 | 569 |
566 void PanelLayoutManager::MinimizePanel(aura::Window* panel) { | 570 void PanelLayoutManager::MinimizePanel(aura::Window* panel) { |
567 ::wm::SetWindowVisibilityAnimationType( | 571 ::wm::SetWindowVisibilityAnimationType( |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 // Keyboard hidden, restore original bounds if they exist. | 936 // Keyboard hidden, restore original bounds if they exist. |
933 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); | 937 SetChildBounds(panel, panel_state->GetRestoreBoundsInScreen()); |
934 } | 938 } |
935 } | 939 } |
936 // This bounds change will have caused a change to the Shelf which does not | 940 // This bounds change will have caused a change to the Shelf which does not |
937 // propogate automatically to this class, so manually recalculate bounds. | 941 // propogate automatically to this class, so manually recalculate bounds. |
938 OnWindowResized(); | 942 OnWindowResized(); |
939 } | 943 } |
940 | 944 |
941 } // namespace ash | 945 } // namespace ash |
OLD | NEW |