Commit 5dc1b344 authored by Mitsuru Oshima's avatar Mitsuru Oshima Committed by Commit Bot

Revert "Overview optimizations"

This reverts commit a9fdf9b7.

Reason for revert: due to null reference. I'll revert and land new one with fix to make merge easier.

Original change's description:
> Overview optimizations
> 
> * Pause occusion tracker during overview animation
> * Activate the text filter after animation
> * Don't animate backdrop window during overview animation.
> * Fix the bounds change issue in WindowGrid. It shouldn't change
> the parent window's bounds.
> 
>   in both clamshell and tabletmode.
>   The web contents should load after animations without backdrop animation.
>   No gap at the bottom of the screen after exiting overview mode.
> 
> Bug: 898077, 897387
> Test: no functional change. Manually tested visual change by entering/exiting overview mode
> Change-Id: I60c2709c5394a565bae6d0c4bfdd7006e2e76496
> Reviewed-on: https://chromium-review.googlesource.com/c/1304973
> Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
> Reviewed-by: Sammie Quon <sammiequon@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#604206}

TBR=oshima@chromium.org,sammiequon@chromium.org

Change-Id: Ied4ce4d12abc962bffead6e22bbd7e2a837ad544
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 898077, 897387
Reviewed-on: https://chromium-review.googlesource.com/c/1311793
Commit-Queue: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604430}
parent a48ba696
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wm/overview/cleanup_animation_observer.h" #include "ash/wm/overview/cleanup_animation_observer.h"
#include "ash/wm/overview/scoped_overview_animation_settings.h" #include "ash/wm/overview/scoped_overview_animation_settings.h"
#include "ash/wm/overview/start_animation_observer.h"
#include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_controller.h"
#include "ash/wm/window_state.h" #include "ash/wm/window_state.h"
...@@ -140,14 +139,8 @@ void FadeInWidgetAndMaybeSlideOnEnter(views::Widget* widget, ...@@ -140,14 +139,8 @@ void FadeInWidgetAndMaybeSlideOnEnter(views::Widget* widget,
ScopedOverviewAnimationSettings scoped_overview_animation_settings( ScopedOverviewAnimationSettings scoped_overview_animation_settings(
animation_type, window); animation_type, window);
window->layer()->SetOpacity(1.0f); window->layer()->SetOpacity(1.0f);
if (slide) { if (slide)
window->SetTransform(original_transform); window->SetTransform(original_transform);
auto start_observer = std::make_unique<StartAnimationObserver>();
scoped_overview_animation_settings.AddObserver(start_observer.get());
Shell::Get()->window_selector_controller()->AddStartAnimationObserver(
std::move(start_observer));
}
} }
void FadeOutWidgetAndMaybeSlideOnExit(std::unique_ptr<views::Widget> widget, void FadeOutWidgetAndMaybeSlideOnExit(std::unique_ptr<views::Widget> widget,
......
...@@ -1104,6 +1104,7 @@ void WindowGrid::InitShieldWidget() { ...@@ -1104,6 +1104,7 @@ void WindowGrid::InitShieldWidget() {
aura::Window* parent_window = widget_window->parent(); aura::Window* parent_window = widget_window->parent();
const gfx::Rect bounds = ash::screen_util::SnapBoundsToDisplayEdge( const gfx::Rect bounds = ash::screen_util::SnapBoundsToDisplayEdge(
parent_window->bounds(), parent_window); parent_window->bounds(), parent_window);
parent_window->SetBounds(bounds);
widget_window->SetBounds(bounds); widget_window->SetBounds(bounds);
widget_window->SetName("OverviewModeShield"); widget_window->SetName("OverviewModeShield");
......
...@@ -50,7 +50,6 @@ ...@@ -50,7 +50,6 @@
#include "ui/views/controls/image_view.h" #include "ui/views/controls/image_view.h"
#include "ui/views/controls/textfield/textfield.h" #include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h" #include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/wm/core/coordinate_conversion.h" #include "ui/wm/core/coordinate_conversion.h"
#include "ui/wm/core/window_util.h" #include "ui/wm/core/window_util.h"
#include "ui/wm/public/activation_client.h" #include "ui/wm/public/activation_client.h"
...@@ -105,27 +104,6 @@ struct WindowSelectorItemForRoot { ...@@ -105,27 +104,6 @@ struct WindowSelectorItemForRoot {
const aura::Window* root_window; const aura::Window* root_window;
}; };
// A WidgetDelegate to specify the initialy focused view.
class TextFilterWidgetDelegate : public views::WidgetDelegate {
public:
TextFilterWidgetDelegate(views::Widget* widget, views::View* initial_focus)
: widget_(widget), initial_focus_(initial_focus) {}
~TextFilterWidgetDelegate() override = default;
// WidgetDelegate:
void DeleteDelegate() override { delete this; }
views::Widget* GetWidget() override { return widget_; }
const views::Widget* GetWidget() const override { return widget_; }
bool ShouldAdvanceFocusToTopLevelWidget() const override { return true; }
views::View* GetInitiallyFocusedView() override { return initial_focus_; }
private:
views::Widget* widget_;
views::View* initial_focus_;
DISALLOW_COPY_AND_ASSIGN(TextFilterWidgetDelegate);
};
// Triggers a shelf visibility update on all root window controllers. // Triggers a shelf visibility update on all root window controllers.
void UpdateShelfVisibility() { void UpdateShelfVisibility() {
for (aura::Window* root : Shell::GetAllRootWindows()) for (aura::Window* root : Shell::GetAllRootWindows())
...@@ -224,9 +202,6 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller, ...@@ -224,9 +202,6 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller,
params.name = "OverviewModeTextFilter"; params.name = "OverviewModeTextFilter";
*text_filter_bottom = params.bounds.bottom() + kTextFieldBottomMargin; *text_filter_bottom = params.bounds.bottom() + kTextFieldBottomMargin;
params.parent = root_window->GetChildById(kShellWindowId_StatusContainer); params.parent = root_window->GetChildById(kShellWindowId_StatusContainer);
views::Textfield* textfield = new views::Textfield();
params.delegate = new TextFilterWidgetDelegate(widget, textfield);
widget->Init(params); widget->Init(params);
// Use |container| to specify the padding surrounding the text and to give // Use |container| to specify the padding surrounding the text and to give
...@@ -246,6 +221,7 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller, ...@@ -246,6 +221,7 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller,
vertical_padding, kTextFilterCornerRadius), vertical_padding, kTextFilterCornerRadius),
kTextFilterHorizontalPadding)); kTextFilterHorizontalPadding));
views::Textfield* textfield = new views::Textfield();
textfield->set_controller(controller); textfield->set_controller(controller);
textfield->SetBorder(views::NullBorder()); textfield->SetBorder(views::NullBorder());
textfield->SetBackgroundColor(kTextFilterBackgroundColor); textfield->SetBackgroundColor(kTextFilterBackgroundColor);
...@@ -269,6 +245,8 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller, ...@@ -269,6 +245,8 @@ views::Widget* CreateTextFilter(views::TextfieldController* controller,
aura::Window* text_filter_widget_window = widget->GetNativeWindow(); aura::Window* text_filter_widget_window = widget->GetNativeWindow();
text_filter_widget_window->layer()->SetOpacity(0); text_filter_widget_window->layer()->SetOpacity(0);
text_filter_widget_window->SetTransform(transform); text_filter_widget_window->SetTransform(transform);
widget->Show();
textfield->RequestFocus();
return widget; return widget;
} }
...@@ -769,14 +747,6 @@ void WindowSelector::UpdateMaskAndShadow(bool show) { ...@@ -769,14 +747,6 @@ void WindowSelector::UpdateMaskAndShadow(bool show) {
} }
} }
void WindowSelector::OnStartingAnimationComplete(bool canceled) {
if (!canceled) {
UpdateMaskAndShadow(!canceled);
if (text_filter_widget_)
text_filter_widget_->Show();
}
}
void WindowSelector::OnDisplayRemoved(const display::Display& display) { void WindowSelector::OnDisplayRemoved(const display::Display& display) {
// TODO(flackr): Keep window selection active on remaining displays. // TODO(flackr): Keep window selection active on remaining displays.
CancelSelection(); CancelSelection();
......
...@@ -217,9 +217,6 @@ class ASH_EXPORT WindowSelector : public display::DisplayObserver, ...@@ -217,9 +217,6 @@ class ASH_EXPORT WindowSelector : public display::DisplayObserver,
// Shows or hides all the window selector items' mask and shadow. // Shows or hides all the window selector items' mask and shadow.
void UpdateMaskAndShadow(bool show); void UpdateMaskAndShadow(bool show);
// Called when the overview mode starting animation completes.
void OnStartingAnimationComplete(bool canceled);
WindowSelectorDelegate* delegate() { return delegate_; } WindowSelectorDelegate* delegate() { return delegate_; }
SplitViewDragIndicators* split_view_drag_indicators() { SplitViewDragIndicators* split_view_drag_indicators() {
......
...@@ -298,11 +298,6 @@ bool WindowSelectorController::ToggleOverview( ...@@ -298,11 +298,6 @@ bool WindowSelectorController::ToggleOverview(
return true; return true;
} }
// Suspend occlusion tracker until the enter animation is complete.
occlusion_tracker_pauser_ =
std::make_unique<aura::WindowOcclusionTracker::ScopedPause>(
Shell::Get()->aura_env());
window_selector_->set_enter_exit_overview_type(new_type); window_selector_->set_enter_exit_overview_type(new_type);
if (type == WindowSelector::EnterExitOverviewType::kWindowsMinimized || if (type == WindowSelector::EnterExitOverviewType::kWindowsMinimized ||
type == WindowSelector::EnterExitOverviewType::kSwipeFromShelf) { type == WindowSelector::EnterExitOverviewType::kSwipeFromShelf) {
...@@ -330,39 +325,23 @@ bool WindowSelectorController::ToggleOverview( ...@@ -330,39 +325,23 @@ bool WindowSelectorController::ToggleOverview(
// Clear any animations that may be running from last overview end. // Clear any animations that may be running from last overview end.
for (const auto& animation : delayed_animations_) for (const auto& animation : delayed_animations_)
animation->Shutdown(); animation->Shutdown();
if (!delayed_animations_.empty()) if (!delayed_animations_.empty()) {
OnStartingAnimationComplete(/*canceled=*/true); Shell::Get()->NotifyOverviewModeStartingAnimationComplete(
/*canceled=*/true);
}
delayed_animations_.clear(); delayed_animations_.clear();
// Suspend occlusion tracker until the exit animation is complete.
occlusion_tracker_pauser_ =
std::make_unique<aura::WindowOcclusionTracker::ScopedPause>(
Shell::Get()->aura_env());
window_selector_ = std::make_unique<WindowSelector>(this); window_selector_ = std::make_unique<WindowSelector>(this);
window_selector_->set_enter_exit_overview_type(new_type); window_selector_->set_enter_exit_overview_type(new_type);
Shell::Get()->NotifyOverviewModeStarting(); Shell::Get()->NotifyOverviewModeStarting();
window_selector_->Init(windows, hide_windows); window_selector_->Init(windows, hide_windows);
if (IsBlurAllowed()) if (IsBlurAllowed())
overview_blur_controller_->Blur(); overview_blur_controller_->Blur();
if (start_animations_.empty())
OnStartingAnimationComplete(/*canceled=*/false);
OnSelectionStarted(); OnSelectionStarted();
} }
return true; return true;
} }
void WindowSelectorController::OnStartingAnimationComplete(bool canceled) {
Shell::Get()->NotifyOverviewModeStartingAnimationComplete(canceled);
window_selector_->OnStartingAnimationComplete(canceled);
occlusion_tracker_pauser_.reset();
}
void WindowSelectorController::OnEndingAnimationComplete(bool canceled) {
Shell::Get()->NotifyOverviewModeEndingAnimationComplete(canceled);
occlusion_tracker_pauser_.reset();
}
bool WindowSelectorController::IsSelecting() const { bool WindowSelectorController::IsSelecting() const {
return window_selector_ != nullptr; return window_selector_ != nullptr;
} }
...@@ -501,14 +480,15 @@ void WindowSelectorController::OnSelectionEnded() { ...@@ -501,14 +480,15 @@ void WindowSelectorController::OnSelectionEnded() {
if (is_shutting_down_) if (is_shutting_down_)
return; return;
if (!start_animations_.empty()) if (!start_animations_.empty()) {
OnEndingAnimationComplete(/*canceled=*/true); Shell::Get()->NotifyOverviewModeEndingAnimationComplete(
/*canceled=*/true);
}
start_animations_.clear(); start_animations_.clear();
window_selector_->UpdateMaskAndShadow(/*show=*/false);
is_shutting_down_ = true; is_shutting_down_ = true;
Shell::Get()->NotifyOverviewModeEnding(); Shell::Get()->NotifyOverviewModeEnding();
auto* window_selector = window_selector_.release(); auto* window_selector = window_selector_.release();
window_selector->UpdateMaskAndShadow(/*show=*/false);
window_selector->Shutdown(); window_selector->Shutdown();
// There may be no delayed animations in tests, so unblur right away. // There may be no delayed animations in tests, so unblur right away.
if (delayed_animations_.empty() && IsBlurAllowed()) if (delayed_animations_.empty() && IsBlurAllowed())
...@@ -539,8 +519,7 @@ void WindowSelectorController::RemoveAndDestroyAnimationObserver( ...@@ -539,8 +519,7 @@ void WindowSelectorController::RemoveAndDestroyAnimationObserver(
if (!window_selector_ && !previous_empty && delayed_animations_.empty()) { if (!window_selector_ && !previous_empty && delayed_animations_.empty()) {
if (IsBlurAllowed()) if (IsBlurAllowed())
overview_blur_controller_->Unblur(); overview_blur_controller_->Unblur();
Shell::Get()->NotifyOverviewModeEndingAnimationComplete(/*canceled=*/false);
OnEndingAnimationComplete(/*canceled=*/false);
} }
} }
...@@ -555,8 +534,11 @@ void WindowSelectorController::RemoveAndDestroyStartAnimationObserver( ...@@ -555,8 +534,11 @@ void WindowSelectorController::RemoveAndDestroyStartAnimationObserver(
const bool previous_empty = start_animations_.empty(); const bool previous_empty = start_animations_.empty();
base::EraseIf(start_animations_, base::MatchesUniquePtr(animation_observer)); base::EraseIf(start_animations_, base::MatchesUniquePtr(animation_observer));
if (!previous_empty && start_animations_.empty()) if (!previous_empty && start_animations_.empty()) {
OnStartingAnimationComplete(/*canceled=*/false); Shell::Get()->NotifyOverviewModeStartingAnimationComplete(
/*canceled=*/false);
window_selector_->UpdateMaskAndShadow(/*show=*/true);
}
} }
// static // static
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "ash/wm/overview/window_selector_delegate.h" #include "ash/wm/overview/window_selector_delegate.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "ui/aura/window_occlusion_tracker.h"
namespace ash { namespace ash {
class WindowSelector; class WindowSelector;
...@@ -98,9 +97,6 @@ class ASH_EXPORT WindowSelectorController : public WindowSelectorDelegate { ...@@ -98,9 +97,6 @@ class ASH_EXPORT WindowSelectorController : public WindowSelectorDelegate {
// Dispatched when window selection begins. // Dispatched when window selection begins.
void OnSelectionStarted(); void OnSelectionStarted();
void OnStartingAnimationComplete(bool canceled);
void OnEndingAnimationComplete(bool canceled);
// Collection of DelayedAnimationObserver objects that own widgets that may be // Collection of DelayedAnimationObserver objects that own widgets that may be
// still animating after overview mode ends. If shell needs to shut down while // still animating after overview mode ends. If shell needs to shut down while
// those animations are in progress, the animations are shut down and the // those animations are in progress, the animations are shut down and the
...@@ -110,9 +106,6 @@ class ASH_EXPORT WindowSelectorController : public WindowSelectorDelegate { ...@@ -110,9 +106,6 @@ class ASH_EXPORT WindowSelectorController : public WindowSelectorDelegate {
// notify shell that the starting animations have been completed. // notify shell that the starting animations have been completed.
std::vector<std::unique_ptr<DelayedAnimationObserver>> start_animations_; std::vector<std::unique_ptr<DelayedAnimationObserver>> start_animations_;
std::unique_ptr<aura::WindowOcclusionTracker::ScopedPause>
occlusion_tracker_pauser_;
std::unique_ptr<WindowSelector> window_selector_; std::unique_ptr<WindowSelector> window_selector_;
base::Time last_selection_time_; base::Time last_selection_time_;
......
...@@ -15,11 +15,9 @@ ...@@ -15,11 +15,9 @@
#include "ash/public/cpp/app_types.h" #include "ash/public/cpp/app_types.h"
#include "ash/public/cpp/shell_window_ids.h" #include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h" #include "ash/public/cpp/window_properties.h"
#include "ash/screen_util.h"
#include "ash/shell.h" #include "ash/shell.h"
#include "ash/wallpaper/wallpaper_controller.h" #include "ash/wallpaper/wallpaper_controller.h"
#include "ash/wm/overview/window_selector_controller.h" #include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/window_state.h"
#include "ash/wm/window_util.h" #include "ash/wm/window_util.h"
#include "ash/wm/workspace/backdrop_delegate.h" #include "ash/wm/workspace/backdrop_delegate.h"
#include "base/auto_reset.h" #include "base/auto_reset.h"
...@@ -70,7 +68,7 @@ class BackdropEventHandler : public ui::EventHandler { ...@@ -70,7 +68,7 @@ class BackdropEventHandler : public ui::EventHandler {
} // namespace } // namespace
BackdropController::BackdropController(aura::Window* container) BackdropController::BackdropController(aura::Window* container)
: container_(container) { : container_(container), in_restacking_(false) {
DCHECK(container_); DCHECK(container_);
Shell::Get()->AddShellObserver(this); Shell::Get()->AddShellObserver(this);
Shell::Get()->accessibility_controller()->AddObserver(this); Shell::Get()->accessibility_controller()->AddObserver(this);
...@@ -103,10 +101,6 @@ void BackdropController::OnWindowStackingChanged(aura::Window* window) { ...@@ -103,10 +101,6 @@ void BackdropController::OnWindowStackingChanged(aura::Window* window) {
UpdateBackdrop(); UpdateBackdrop();
} }
void BackdropController::OnDisplayMetricsChanged() {
UpdateBackdrop();
}
void BackdropController::OnPostWindowStateTypeChange( void BackdropController::OnPostWindowStateTypeChange(
wm::WindowState* window_state, wm::WindowState* window_state,
mojom::WindowStateType old_type) { mojom::WindowStateType old_type) {
...@@ -123,8 +117,8 @@ void BackdropController::UpdateBackdrop() { ...@@ -123,8 +117,8 @@ void BackdropController::UpdateBackdrop() {
// No need to continue update for recursive calls or in overview mode. // No need to continue update for recursive calls or in overview mode.
WindowSelectorController* window_selector_controller = WindowSelectorController* window_selector_controller =
Shell::Get()->window_selector_controller(); Shell::Get()->window_selector_controller();
if (pause_update_ || (window_selector_controller && if (in_restacking_ || (window_selector_controller &&
window_selector_controller->IsSelecting())) { window_selector_controller->IsSelecting())) {
return; return;
} }
...@@ -135,14 +129,12 @@ void BackdropController::UpdateBackdrop() { ...@@ -135,14 +129,12 @@ void BackdropController::UpdateBackdrop() {
return; return;
} }
// We are changing the order of windows which will cause recursion. // We are changing the order of windows which will cause recursion.
base::AutoReset<bool> lock(&pause_update_, true); base::AutoReset<bool> lock(&in_restacking_, true);
EnsureBackdropWidget(); EnsureBackdropWidget();
UpdateAccessibilityMode(); UpdateAccessibilityMode();
if (window == backdrop_window_ && backdrop_->IsVisible()) { if (window == backdrop_window_ && backdrop_->IsVisible())
Layout();
return; return;
}
if (window->GetRootWindow() != backdrop_window_->GetRootWindow()) if (window->GetRootWindow() != backdrop_window_->GetRootWindow())
return; return;
...@@ -156,20 +148,11 @@ void BackdropController::UpdateBackdrop() { ...@@ -156,20 +148,11 @@ void BackdropController::UpdateBackdrop() {
} }
void BackdropController::OnOverviewModeStarting() { void BackdropController::OnOverviewModeStarting() {
if (backdrop_window_)
backdrop_window_->SetProperty(aura::client::kAnimationsDisabledKey, true);
Hide(); Hide();
} }
void BackdropController::OnOverviewModeEnding() { void BackdropController::OnOverviewModeEnded() {
pause_update_ = true;
}
void BackdropController::OnOverviewModeEndingAnimationComplete(bool canceled) {
pause_update_ = false;
UpdateBackdrop(); UpdateBackdrop();
if (backdrop_window_)
backdrop_window_->ClearProperty(aura::client::kAnimationsDisabledKey);
} }
void BackdropController::OnAppListVisibilityChanged(bool shown, void BackdropController::OnAppListVisibilityChanged(bool shown,
...@@ -226,8 +209,6 @@ void BackdropController::EnsureBackdropWidget() { ...@@ -226,8 +209,6 @@ void BackdropController::EnsureBackdropWidget() {
::wm::SetWindowVisibilityAnimationType( ::wm::SetWindowVisibilityAnimationType(
backdrop_window_, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); backdrop_window_, ::wm::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
backdrop_window_->layer()->SetColor(SK_ColorBLACK); backdrop_window_->layer()->SetColor(SK_ColorBLACK);
wm::GetWindowState(backdrop_window_)->set_allow_set_bounds_direct(true);
} }
void BackdropController::UpdateAccessibilityMode() { void BackdropController::UpdateAccessibilityMode() {
...@@ -284,7 +265,11 @@ bool BackdropController::WindowShouldHaveBackdrop(aura::Window* window) { ...@@ -284,7 +265,11 @@ bool BackdropController::WindowShouldHaveBackdrop(aura::Window* window) {
} }
void BackdropController::Show() { void BackdropController::Show() {
Layout(); // Makes sure that the backdrop has the correct bounds if it should not be
// fullscreen size.
backdrop_->SetFullscreen(BackdropShouldFullscreen());
if (!BackdropShouldFullscreen())
backdrop_->SetBounds(GetBackdropBounds());
backdrop_->Show(); backdrop_->Show();
} }
...@@ -330,21 +315,4 @@ gfx::Rect BackdropController::GetBackdropBounds() { ...@@ -330,21 +315,4 @@ gfx::Rect BackdropController::GetBackdropBounds() {
snapped_window, snap_position); snapped_window, snap_position);
} }
void BackdropController::Layout() {
// Makes sure that the backdrop has the correct bounds if it should not be
// fullscreen size.
backdrop_->SetFullscreen(BackdropShouldFullscreen());
if (backdrop_->IsFullscreen()) {
// TODO(oshima): The size of solid color layer can be smaller than texture's
// layer with fractional scale (crbug.com/9000220). Use adjusted bounds so
// that it can cover texture layer. Fix the bug and remove this.
auto* window = backdrop_window_;
gfx::Rect bounds = screen_util::GetDisplayBoundsInParent(window);
backdrop_window_->SetBounds(
screen_util::SnapBoundsToDisplayEdge(bounds, window));
} else {
backdrop_->SetBounds(GetBackdropBounds());
}
}
} // namespace ash } // namespace ash
...@@ -57,7 +57,6 @@ class BackdropController : public ShellObserver, ...@@ -57,7 +57,6 @@ class BackdropController : public ShellObserver,
void OnWindowStackingChanged(aura::Window* window); void OnWindowStackingChanged(aura::Window* window);
void OnPostWindowStateTypeChange(wm::WindowState* window_state, void OnPostWindowStateTypeChange(wm::WindowState* window_state,
mojom::WindowStateType old_type); mojom::WindowStateType old_type);
void OnDisplayMetricsChanged();
void SetBackdropDelegate(std::unique_ptr<BackdropDelegate> delegate); void SetBackdropDelegate(std::unique_ptr<BackdropDelegate> delegate);
...@@ -69,8 +68,7 @@ class BackdropController : public ShellObserver, ...@@ -69,8 +68,7 @@ class BackdropController : public ShellObserver,
// ShellObserver: // ShellObserver:
void OnOverviewModeStarting() override; void OnOverviewModeStarting() override;
void OnOverviewModeEnding() override; void OnOverviewModeEnded() override;
void OnOverviewModeEndingAnimationComplete(bool canceled) override;
void OnAppListVisibilityChanged(bool shown, void OnAppListVisibilityChanged(bool shown,
aura::Window* root_window) override; aura::Window* root_window) override;
void OnSplitViewModeStarting() override; void OnSplitViewModeStarting() override;
...@@ -94,8 +92,6 @@ class BackdropController : public ShellObserver, ...@@ -94,8 +92,6 @@ class BackdropController : public ShellObserver,
void UpdateAccessibilityMode(); void UpdateAccessibilityMode();
void Layout();
// Returns the current visible top level window in the container. // Returns the current visible top level window in the container.
aura::Window* GetTopmostWindowWithBackdrop(); aura::Window* GetTopmostWindowWithBackdrop();
...@@ -134,10 +130,8 @@ class BackdropController : public ShellObserver, ...@@ -134,10 +130,8 @@ class BackdropController : public ShellObserver,
std::unique_ptr<ui::EventHandler> backdrop_event_handler_; std::unique_ptr<ui::EventHandler> backdrop_event_handler_;
ui::EventHandler* original_event_handler_ = nullptr; ui::EventHandler* original_event_handler_ = nullptr;
// If true, skip updating background. Used to avoid recursive update // If true, the |RestackOrHideWindow| might recurse.
// when updating the window stack, or delay hiding the backdrop bool in_restacking_ = false;
// in overview mode.
bool pause_update_ = false;
DISALLOW_COPY_AND_ASSIGN(BackdropController); DISALLOW_COPY_AND_ASSIGN(BackdropController);
}; };
......
...@@ -387,7 +387,6 @@ void WorkspaceLayoutManager::OnDisplayMetricsChanged( ...@@ -387,7 +387,6 @@ void WorkspaceLayoutManager::OnDisplayMetricsChanged(
const wm::WMEvent event(wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED); const wm::WMEvent event(wm::WM_EVENT_WORKAREA_BOUNDS_CHANGED);
AdjustAllWindowsBoundsForWorkAreaChange(&event); AdjustAllWindowsBoundsForWorkAreaChange(&event);
} }
backdrop_controller_->OnDisplayMetricsChanged();
} }
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
......
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