Commit 2c731240 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Prevent crash with scrollable shelf disabled

Handle the case where scrollable shelf is disabled.

Bug: 1009609
Change-Id: I97c82661bd32b4355e3ed4664c6c2424f1dd2276
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832683
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701300}
parent 0fec1f33
......@@ -87,6 +87,9 @@ HotseatWidget::DelegateView::~DelegateView() {
void HotseatWidget::DelegateView::Init(
ScrollableShelfView* scrollable_shelf_view,
ui::Layer* parent_layer) {
if (!chromeos::switches::ShouldShowScrollableShelf())
return;
if (wallpaper_controller_)
wallpaper_controller_->AddObserver(this);
SetLayoutManager(std::make_unique<views::FillLayout>());
......@@ -145,6 +148,9 @@ bool HotseatWidget::DelegateView::CanActivate() const {
}
void HotseatWidget::DelegateView::ReorderChildLayers(ui::Layer* parent_layer) {
if (!chromeos::switches::ShouldShowScrollableShelf())
return;
views::View::ReorderChildLayers(parent_layer);
parent_layer->StackAtBottom(&opaque_background_);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment