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

Unified Diff: ash/shelf/shelf_layout_manager.cc

Issue 2889673002: chromeos: Refactor shelf to create ShelfView earlier in startup (Closed)
Patch Set: Move ShelfView to initializer list 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 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())

Powered by Google App Engine
This is Rietveld 408576698