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

Unified Diff: athena/wm/window_overview_mode.cc

Issue 555463003: [Athena] Fix potential crash when overview window is deleted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/wm/window_overview_mode.cc
diff --git a/athena/wm/window_overview_mode.cc b/athena/wm/window_overview_mode.cc
index b9a58fe6b74e21c3a508ab528a69b936b8934377..37b8492d49ce8ee5e59962c889bb65b8f59a0c01 100644
--- a/athena/wm/window_overview_mode.cc
+++ b/athena/wm/window_overview_mode.cc
@@ -28,6 +28,7 @@
#include "ui/gfx/frame_time.h"
#include "ui/gfx/transform.h"
#include "ui/wm/core/shadow_types.h"
+#include "ui/wm/core/window_animations.h"
#include "ui/wm/core/window_util.h"
namespace {
@@ -479,12 +480,9 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
void CloseDragWindow(const ui::GestureEvent& gesture) {
// Animate |dragged_window_| offscreen first, then destroy it.
{
- ui::ScopedLayerAnimationSettings settings(
- dragged_window_->layer()->GetAnimator());
- settings.SetPreemptionStrategy(
+ wm::ScopedHidingAnimationSettings settings(dragged_window_);
+ settings.layer_animation_settings()->SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
- settings.AddObserver(new ui::ClosureAnimationObserver(
- base::Bind(&base::DeletePointer<aura::Window>, dragged_window_)));
WindowOverviewState* dragged_state =
dragged_window_->GetProperty(kWindowOverviewState);
@@ -546,6 +544,7 @@ class WindowOverviewModeImpl : public WindowOverviewMode,
}
}
+ delete dragged_window_;
dragged_window_ = NULL;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698