Commit 638b033e authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros:Fix shelf bg blur snapping on windowed->maximized.

We cannot animate opacity on a layer with blur, the result is that
the blur will dissapear while the opacity is animating. This appears
visually as a 'snap' away of the blur effect.

Because this opacity animation is happening so quickly, just make it
animate instantly to prevent the blur snapping away. (preferred by UX.)

Also remove an un-used function, and some stale header includes.

Bug: 956187
Change-Id: I24480bab1b2ef377c253047ac5748c03e215ee81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584927Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654622}
parent 1c1908bf
......@@ -8,15 +8,12 @@
#include <memory>
#include "ash/animation/animation_change_type.h"
#include "ash/public/cpp/ash_switches.h"
#include "ash/public/cpp/login_constants.h"
#include "ash/public/cpp/wallpaper_types.h"
#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_background_animator_observer.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shell.h"
#include "ash/wallpaper/wallpaper_controller.h"
#include "base/command_line.h"
#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/color_analysis.h"
#include "ui/gfx/color_palette.h"
......
......@@ -40,6 +40,7 @@
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h"
#include "ash/wm/work_area_insets.h"
#include "ash/wm/workspace/workspace_types.h"
#include "ash/wm/workspace_controller.h"
#include "base/auto_reset.h"
#include "base/command_line.h"
......@@ -793,9 +794,12 @@ void ShelfLayoutManager::SetState(ShelfVisibilityState visibility_state) {
// in tablet mode.
// - Going from an auto hidden shelf in tablet mode to a visible shelf in
// tablet mode.
if (state.visibility_state == SHELF_VISIBLE &&
state.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED &&
old_state.visibility_state != SHELF_VISIBLE) {
// - Doing so would result in animating the opacity of the shelf while it is
// showing blur.
if (state.window_state == wm::WORKSPACE_WINDOW_STATE_MAXIMIZED &&
((state.visibility_state == SHELF_VISIBLE &&
old_state.visibility_state != SHELF_VISIBLE) ||
is_background_blur_enabled_)) {
change_type = AnimationChangeType::IMMEDIATE;
} else {
// Delay the animation when the shelf was hidden, and has just been made
......
......@@ -401,11 +401,6 @@ void ShelfWidget::CreateStatusAreaWidget(aura::Window* status_container) {
status_container->SetLayoutManager(new StatusAreaLayoutManager(this));
}
void ShelfWidget::SetPaintsBackground(ShelfBackgroundType background_type,
AnimationChangeType change_type) {
background_animator_.PaintBackground(background_type, change_type);
}
ShelfBackgroundType ShelfWidget::GetBackgroundType() const {
return background_animator_.target_background_type();
}
......
......@@ -62,9 +62,6 @@ class ASH_EXPORT ShelfWidget : public views::Widget,
void OnTabletModeChanged();
// Sets the shelf's background type.
void SetPaintsBackground(ShelfBackgroundType background_type,
AnimationChangeType change_type);
ShelfBackgroundType GetBackgroundType() const;
// Gets the alpha value of |background_type|.
......
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