Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: ash/common/wm/panels/panel_layout_manager.cc

Issue 2108383002: Fixes crash in PanelLayoutManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698