Commit bfcaaf02 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

Revert "overview: Fade the crostini window back in if it fails to close."

This reverts commit c3f6c6c0.

Reason for revert: Causes regressions in the below linked bugs.

Original change's description:
> overview: Fade the crostini window back in if it fails to close.
> 
> The crostini installer (and other non-closeable) windows will reverse
> their animations in overview if the CloseWidget call fails to close
> the window.
> 
> Test: manual
> Bug: 970196
> Change-Id: I7aeab07c9d7f2f5e94a34ac8b3a43bdde3610b6f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2121346
> Commit-Queue: Sammie Quon <sammiequon@chromium.org>
> Reviewed-by: Xiaoqian Dai <xdai@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#753660}

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Id0a29e92c3711a79771a22a59a8301a1fa5a43f1
Fixed: 1066167, 1066169
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2128230Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#754631}
parent cb0f6a90
......@@ -971,12 +971,6 @@ void OverviewItem::OnHighlightedViewClosed() {
overview_session_->OnHighlightedItemClosed(this);
}
void OverviewItem::OnWindowDidNotClose() {
// If the window failed to close reverse the opacity and transform animations.
AnimateOpacity(1.0, OVERVIEW_ANIMATION_CLOSE_OVERVIEW_ITEM);
overview_grid_->PositionWindows(/*animate=*/true);
}
void OverviewItem::ButtonPressed(views::Button* sender,
const ui::Event& event) {
DCHECK_EQ(sender, overview_item_view_->close_button());
......
......@@ -201,12 +201,6 @@ class ASH_EXPORT OverviewItem : public views::ButtonListener,
void OnHighlightedViewActivated();
void OnHighlightedViewClosed();
// Called when we try to close a window that is not closeable. The close
// animation happens before we try to call Widget::Close. This will get
// called after Widget::Close if the window was not closed, so we can reverse
// the close animation.
void OnWindowDidNotClose();
// views::ButtonListener:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
......
......@@ -454,24 +454,10 @@ void ScopedOverviewTransformWindow::OnTransientChildWindowRemoved(
event_targeting_blocker_map_.erase(transient_child);
}
void ScopedOverviewTransformWindow::OnWindowDestroying(aura::Window* window) {
DCHECK_EQ(window, window_);
window->RemoveObserver(this);
window_has_closed_ = true;
}
void ScopedOverviewTransformWindow::CloseWidget() {
aura::Window* parent_window = ::wm::GetTransientRoot(window_);
DCHECK(parent_window);
window_->AddObserver(this);
window_util::CloseWidgetForWindow(parent_window);
if (window_has_closed_)
return;
// Notify |overview_item_| the window failed to close.
window_->RemoveObserver(this);
overview_item_->OnWindowDidNotClose();
if (parent_window)
window_util::CloseWidgetForWindow(parent_window);
}
// static
......
......@@ -15,7 +15,6 @@
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "ui/aura/client/transient_window_client_observer.h"
#include "ui/aura/window_observer.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "ui/gfx/geometry/size.h"
......@@ -36,8 +35,7 @@ class ScopedOverviewHideWindows;
// fit in certain bounds. The window's state is restored when this object is
// destroyed.
class ASH_EXPORT ScopedOverviewTransformWindow
: public aura::client::TransientWindowClientObserver,
public aura::WindowObserver {
: public aura::client::TransientWindowClientObserver {
public:
// Overview windows have certain properties if their aspect ratio exceeds a
// threshold. This enum keeps track of which category the window falls into,
......@@ -146,9 +144,6 @@ class ASH_EXPORT ScopedOverviewTransformWindow
void OnTransientChildWindowRemoved(aura::Window* parent,
aura::Window* transient_child) override;
// aura::WindowObserver:
void OnWindowDestroying(aura::Window* window) override;
aura::Window* window() const { return window_; }
GridWindowFillMode type() const { return type_; }
......@@ -203,10 +198,6 @@ class ASH_EXPORT ScopedOverviewTransformWindow
// splitview clipping overrides any top view inset clipping there may be.
bool has_aspect_ratio_clipping_ = false;
// Flag which tracks if a call to CloseWidget() has actually closed |window_|.
// If true, notifies |overview_item_| to reverse some animations.
bool window_has_closed_ = false;
std::unique_ptr<ScopedOverviewHideWindows> hidden_transient_children_;
base::WeakPtrFactory<ScopedOverviewTransformWindow> weak_ptr_factory_{this};
......
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