Commit c5990315 authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

CrOS Shelf: enable bg blur only when app list blue is on

Enable shelf background blur only when the launcher's background
blur is enabled.

This allows for a more consistent user experience, and may also
help with performance on some devices.

Bug: 879962,881134
Change-Id: I40015199f3312b62ef7b175167b65d5a9a6e352a
Reviewed-on: https://chromium-review.googlesource.com/1217584
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590230}
parent e64a63c3
......@@ -145,6 +145,9 @@ class ASH_EXPORT ShelfLayoutManager
// it's only allowed in tablet mode, not in laptop mode.
bool IsDraggingWindowFromTopOrCaptionArea() const;
// Returns whether background blur is enabled.
bool IsBackgroundBlurEnabled() { return is_background_blur_enabled_; }
// Overridden from wm::WmSnapToPixelLayoutManager:
void OnWindowResized() override;
void SetChildBounds(aura::Window* child,
......
......@@ -217,7 +217,8 @@ void ShelfWidget::DelegateView::UpdateOpaqueBackground() {
mask_ = views::Painter::CreatePaintedLayer(
views::Painter::CreateSolidRoundRectPainter(SK_ColorBLACK, radius));
mask_->layer()->SetBounds(opaque_background_bounds);
opaque_background_.SetBackgroundBlur(kShelfBlurRadius);
if (shelf_widget_->shelf_layout_manager()->IsBackgroundBlurEnabled())
opaque_background_.SetBackgroundBlur(kShelfBlurRadius);
opaque_background_.SetMaskLayer(mask_->layer());
}
}
......@@ -249,6 +250,7 @@ ShelfWidget::ShelfWidget(aura::Window* shelf_container, Shelf* shelf)
background_animator_(SHELF_BACKGROUND_DEFAULT,
shelf_,
Shell::Get()->wallpaper_controller()),
shelf_layout_manager_(new ShelfLayoutManager(this, shelf)),
delegate_view_(new DelegateView(this)),
shelf_view_(new ShelfView(Shell::Get()->shelf_model(), shelf_, this)),
login_shelf_view_(
......@@ -279,7 +281,6 @@ ShelfWidget::ShelfWidget(aura::Window* shelf_container, Shelf* shelf)
GetContentsView()->AddChildView(shelf_view_);
GetContentsView()->AddChildView(login_shelf_view_);
shelf_layout_manager_ = new ShelfLayoutManager(this, shelf_);
shelf_layout_manager_->AddObserver(this);
shelf_container->SetLayoutManager(shelf_layout_manager_);
background_animator_.PaintBackground(
......
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