| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/shelf/shelf_widget.h" | 5 #include "ash/common/shelf/shelf_widget.h" |
| 6 | 6 |
| 7 #include "ash/animation/animation_change_type.h" | 7 #include "ash/animation/animation_change_type.h" |
| 8 #include "ash/common/focus_cycler.h" | 8 #include "ash/common/focus_cycler.h" |
| 9 #include "ash/common/session/session_controller.h" | 9 #include "ash/common/session/session_controller.h" |
| 10 #include "ash/common/shelf/app_list_button.h" | 10 #include "ash/common/shelf/app_list_button.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 // Ensure the newly created |shelf_| gets current values. | 244 // Ensure the newly created |shelf_| gets current values. |
| 245 background_animator_.NotifyObserver(this); | 245 background_animator_.NotifyObserver(this); |
| 246 | 246 |
| 247 // TODO(jamescook): The IsActiveUserSessionStarted() check may not be needed | 247 // TODO(jamescook): The IsActiveUserSessionStarted() check may not be needed |
| 248 // because the shelf is only created after the first user session is active. | 248 // because the shelf is only created after the first user session is active. |
| 249 // The ShelfView seems to always be visible after login. At the lock screen | 249 // The ShelfView seems to always be visible after login. At the lock screen |
| 250 // the shelf is hidden because its container is hidden. During auto-hide it is | 250 // the shelf is hidden because its container is hidden. During auto-hide it is |
| 251 // hidden because ShelfWidget is transparent. Some of the ShelfView visibility | 251 // hidden because ShelfWidget is transparent. Some of the ShelfView visibility |
| 252 // code could be simplified. http://crbug.com/674773 | 252 // code could be simplified. http://crbug.com/674773 |
| 253 // TODO(jdufualt|jamescook): Remove CHECK and shelf_view_->SetVisible call in |
| 254 // m60 or beyond (see above TODO). |
| 255 CHECK(Shell::Get()->session_controller()->IsActiveUserSessionStarted()); |
| 253 shelf_view_->SetVisible( | 256 shelf_view_->SetVisible( |
| 254 Shell::Get()->session_controller()->IsActiveUserSessionStarted()); | 257 Shell::Get()->session_controller()->IsActiveUserSessionStarted()); |
| 255 shelf_layout_manager_->LayoutShelf(); | 258 shelf_layout_manager_->LayoutShelf(); |
| 256 shelf_layout_manager_->UpdateAutoHideState(); | 259 shelf_layout_manager_->UpdateAutoHideState(); |
| 257 Show(); | 260 Show(); |
| 258 } | 261 } |
| 259 | 262 |
| 260 bool ShelfWidget::IsShelfVisible() const { | 263 bool ShelfWidget::IsShelfVisible() const { |
| 261 return shelf_view_ && shelf_view_->visible(); | 264 return shelf_view_ && shelf_view_->visible(); |
| 262 } | 265 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 if (shelf_view_) | 352 if (shelf_view_) |
| 350 shelf_view_->UpdateShelfItemBackground(color); | 353 shelf_view_->UpdateShelfItemBackground(color); |
| 351 } | 354 } |
| 352 | 355 |
| 353 void ShelfWidget::WillDeleteShelfLayoutManager() { | 356 void ShelfWidget::WillDeleteShelfLayoutManager() { |
| 354 shelf_layout_manager_->RemoveObserver(this); | 357 shelf_layout_manager_->RemoveObserver(this); |
| 355 shelf_layout_manager_ = nullptr; | 358 shelf_layout_manager_ = nullptr; |
| 356 } | 359 } |
| 357 | 360 |
| 358 } // namespace ash | 361 } // namespace ash |
| OLD | NEW |