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

Unified Diff: ash/common/shelf/shelf_layout_manager.cc

Issue 2302673002: mash: Avoid shelf crashes on display removal. (Closed)
Patch Set: Sync and rebase; remove Screen/Display changes; cleanup. Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/shelf/shelf_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_layout_manager.cc
diff --git a/ash/common/shelf/shelf_layout_manager.cc b/ash/common/shelf/shelf_layout_manager.cc
index d30c07f53b0021d5b364f347b9c065bdf84c4d66..25202a316f46bd8c07fa00c6c95451889f301a12 100644
--- a/ash/common/shelf/shelf_layout_manager.cc
+++ b/ash/common/shelf/shelf_layout_manager.cc
@@ -198,10 +198,9 @@ ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() {
}
void ShelfLayoutManager::UpdateVisibilityState() {
- WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_);
- WmRootWindowController* controller = shelf_window->GetRootWindowController();
// Bail out early before the shelf is initialized or after it is destroyed.
- if (!controller || !wm_shelf_->IsShelfInitialized() || in_shutdown_)
+ WmWindow* shelf_window = WmLookup::Get()->GetWindowForWidget(shelf_widget_);
+ if (in_shutdown_ || !wm_shelf_->IsShelfInitialized() || !shelf_window)
return;
bool was_invisible_auto_hide_shelf = invisible_auto_hide_shelf_;
// Always reset to be safe.
@@ -214,7 +213,7 @@ void ShelfLayoutManager::UpdateVisibilityState() {
// TODO(zelidrag): Verify shelf drag animation still shows on the device
// when we are in SHELF_AUTO_HIDE_ALWAYS_HIDDEN.
wm::WorkspaceWindowState window_state(
- controller->GetWorkspaceWindowState());
+ shelf_window->GetRootWindowController()->GetWorkspaceWindowState());
switch (window_state) {
case wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN: {
switch (GetShelfModeForFullscreen()) {
« no previous file with comments | « no previous file | ash/common/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698