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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 2889673002: chromeos: Refactor shelf to create ShelfView earlier in startup (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: ash/shelf/shelf_layout_manager.cc
diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc
index 0ab2ec305b1294468aca9f80cf403c63810aeac2..7a26763816fdfc398145a024b170c5c76a4edfff 100644
--- a/ash/shelf/shelf_layout_manager.cc
+++ b/ash/shelf/shelf_layout_manager.cc
@@ -234,10 +234,17 @@ ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() {
}
void ShelfLayoutManager::UpdateVisibilityState() {
- // Bail out early before the shelf is initialized or after it is destroyed.
+ // Shelf is not available before login.
+ // TODO(crbug.com/701157): Remove this when the login webui fake-shelf is
+ // replaced with views.
+ if (!Shell::Get()->session_controller()->IsActiveUserSessionStarted())
+ return;
+
+ // Bail out early after shelf is destroyed.
aura::Window* shelf_window = shelf_widget_->GetNativeWindow();
- if (in_shutdown_ || !wm_shelf_->IsShelfInitialized() || !shelf_window)
+ if (in_shutdown_ || !shelf_window)
return;
+
if (state_.IsScreenLocked() || state_.IsAddingSecondaryUser()) {
SetState(SHELF_VISIBLE);
} else if (Shell::Get()->screen_pinning_controller()->IsPinned()) {
@@ -886,7 +893,13 @@ 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(crbug.com/701157): Remove this when the login 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())

Powered by Google App Engine
This is Rietveld 408576698