Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: ash/common/wm/overview/window_selector_item.cc

Issue 2337383003: [ash-md] Corrects a crash when a window is destroyed after leaving overview (Closed)
Patch Set: [ash-md] Corrects a crash when a window is destroyed after leaving overview Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/wm/overview/window_selector_item.cc
diff --git a/ash/common/wm/overview/window_selector_item.cc b/ash/common/wm/overview/window_selector_item.cc
index acbdfb1b75402001bc4ef32ae3fb70b80a2f4557..aa0431a9a2c38e9568a4240cab27b295cf4db26b 100644
--- a/ash/common/wm/overview/window_selector_item.cc
+++ b/ash/common/wm/overview/window_selector_item.cc
@@ -33,6 +33,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/compositor/layer_animation_sequence.h"
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
+#include "ui/gfx/animation/slide_animation.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/safe_integer_conversions.h"
@@ -197,7 +198,10 @@ class WindowSelectorItem::RoundedContainerView
~RoundedContainerView() override { StopObservingLayerAnimations(); }
- void OnItemRestored() { item_ = nullptr; }
+ void OnItemRestored() {
+ item_ = nullptr;
+ item_window_ = nullptr;
+ }
// Starts observing layer animations so that actions can be taken when
// particular animations (opacity) complete. It should only be called once
@@ -216,6 +220,9 @@ class WindowSelectorItem::RoundedContainerView
layer_ = nullptr;
}
+ // Used by tests to set animation state.
+ gfx::SlideAnimation* animation() { return animation_.get(); }
+
void set_color(SkColor target_color) { target_color_ = target_color; }
// Starts a color animation using |tween_type|. The animation will change the
@@ -896,4 +903,8 @@ void WindowSelectorItem::FadeOut(std::unique_ptr<views::Widget> widget) {
widget_ptr->SetOpacity(0.f);
}
+gfx::SlideAnimation* WindowSelectorItem::GetBackgroundViewAnimation() {
+ return background_view_ ? background_view_->animation() : nullptr;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698