Chromium Code Reviews| Index: ash/shelf/shelf_layout_manager.cc |
| diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc |
| index 19deab0a039b3bbec21e718d8e84468befbb781a..98672563e90e8090e43b516d69290511b33e1546 100644 |
| --- a/ash/shelf/shelf_layout_manager.cc |
| +++ b/ash/shelf/shelf_layout_manager.cc |
| @@ -234,10 +234,16 @@ ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() { |
| } |
| void ShelfLayoutManager::UpdateVisibilityState() { |
| - // Bail out early before the shelf is initialized or after it is destroyed. |
| - WmWindow* shelf_window = WmWindow::Get(shelf_widget_->GetNativeWindow()); |
| - if (in_shutdown_ || !wm_shelf_->IsShelfInitialized() || !shelf_window) |
| + // Shelf is not available before login. |
| + // TODO: Remove this when webui fake-shelf is replaced with views. |
|
msw
2017/05/16 22:42:00
nit: cite the bug, consider " // TODO(crbug.com/#
James Cook
2017/05/17 16:16:12
Done.
|
| + if (!Shell::Get()->session_controller()->IsActiveUserSessionStarted()) |
| + return; |
| + |
| + // Bail out early after shelf is destroyed. |
| + aura::Window* shelf_window = shelf_widget_->GetNativeWindow(); |
| + if (in_shutdown_ || !shelf_window) |
|
James Cook
2017/05/16 21:32:35
It's unclear if the shelf_window check is needed b
msw
2017/05/16 22:42:00
Acknowledged.
|
| return; |
| + |
| if (state_.IsScreenLocked() || state_.IsAddingSecondaryUser()) { |
| SetState(SHELF_VISIBLE); |
| } else if (Shell::Get()->screen_pinning_controller()->IsPinned()) { |
| @@ -246,7 +252,8 @@ 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( |
| - shelf_window->GetRootWindowController()->GetWorkspaceWindowState()); |
| + RootWindowController::ForWindow(shelf_window) |
| + ->GetWorkspaceWindowState()); |
| switch (window_state) { |
| case wm::WORKSPACE_WINDOW_STATE_FULL_SCREEN: { |
| @@ -884,7 +891,12 @@ bool ShelfLayoutManager::HasVisibleWindow() const { |
| ShelfAutoHideState ShelfLayoutManager::CalculateAutoHideState( |
| ShelfVisibilityState visibility_state) const { |
| - if (visibility_state != SHELF_AUTO_HIDE || !wm_shelf_->IsShelfInitialized()) |
| + // Shelf is not available before login. |
| + // TODO: Remove this when webui fake-shelf is replaced with views. |
| + if (!Shell::Get()->session_controller()->IsActiveUserSessionStarted()) |
| + return SHELF_AUTO_HIDE_HIDDEN; |
| + |
| + if (visibility_state != SHELF_AUTO_HIDE) |
| return SHELF_AUTO_HIDE_HIDDEN; |
| if (shelf_widget_->IsShowingAppList()) |