Commit 9e0ce0a6 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Fix crash during folder app list item view creation

AppListItemView ctor was calling SetBackgroundBlurEnabled, which depends
on icon_, before the icon view was actually added as the item view child
(and thus before icon_ ptr was set).

BUG=1043908

Change-Id: I9e5b52c8030899a991e08a462f511bff3292e886
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2018123Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734683}
parent 9eb1ef7c
......@@ -222,19 +222,6 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
apps_grid_view_(apps_grid_view) {
SetFocusBehavior(FocusBehavior::ALWAYS);
auto icon = std::make_unique<IconImageView>();
if (is_folder_) {
// Set background blur for folder icon and use mask layer to clip it into
// circle. Note that blur is only enabled in tablet mode to improve dragging
// smoothness.
if (apps_grid_view_->IsTabletMode())
SetBackgroundBlurEnabled(true);
icon->SetRoundedCornerAndInsets(
GetAppListConfig().folder_icon_radius(),
gfx::Insets(GetAppListConfig().folder_icon_insets()));
}
if (!is_in_folder && !is_folder_) {
// To display shadow for icon while not affecting the icon's bounds, icon
// shadow is behind the icon.
......@@ -260,7 +247,19 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
title_shadow_margins_ = gfx::ShadowValue::GetMargin(title_shadow);
}
icon_ = AddChildView(std::move(icon));
icon_ = AddChildView(std::make_unique<IconImageView>());
if (is_folder_) {
// Set background blur for folder icon and use mask layer to clip it into
// circle. Note that blur is only enabled in tablet mode to improve dragging
// smoothness.
if (apps_grid_view_->IsTabletMode())
SetBackgroundBlurEnabled(true);
icon_->SetRoundedCornerAndInsets(
GetAppListConfig().folder_icon_radius(),
gfx::Insets(GetAppListConfig().folder_icon_insets()));
}
title_ = AddChildView(std::move(title));
progress_bar_ = AddChildView(std::make_unique<views::ProgressBar>());
......
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