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

Unified Diff: ash/wm/toplevel_window_event_filter.h

Issue 10912098: Fix crash if window is destroyed while dragging it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: virtual Created 8 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 | « ash/wm/default_window_resizer.cc ('k') | ash/wm/toplevel_window_event_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_filter.h
diff --git a/ash/wm/toplevel_window_event_filter.h b/ash/wm/toplevel_window_event_filter.h
index de778def69512e2116466c3c4e6414f5ae4b7f87..5b5710c3cf36c1191d1259dce07fd3f9091160c8 100644
--- a/ash/wm/toplevel_window_event_filter.h
+++ b/ash/wm/toplevel_window_event_filter.h
@@ -7,12 +7,12 @@
#include <set>
+#include "ash/ash_export.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "ui/aura/client/window_move_client.h"
#include "ui/aura/event_filter.h"
-#include "ash/ash_export.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
@@ -28,8 +28,8 @@ namespace ash {
class WindowResizer;
-class ASH_EXPORT ToplevelWindowEventFilter :
- public aura::EventFilter,
+class ASH_EXPORT ToplevelWindowEventFilter
+ : public aura::EventFilter,
public aura::client::WindowMoveClient {
public:
explicit ToplevelWindowEventFilter(aura::Window* owner);
@@ -65,11 +65,17 @@ class ASH_EXPORT ToplevelWindowEventFilter :
int window_component);
private:
+ class ScopedWindowResizer;
+
enum DragCompletionStatus {
DRAG_COMPLETE,
DRAG_REVERT
};
+ void CreateScopedWindowResizer(aura::Window* window,
+ const gfx::Point& point_in_parent,
+ int window_component);
+
// Finishes the drag.
void CompleteDrag(DragCompletionStatus status, int event_flags);
@@ -85,6 +91,9 @@ class ASH_EXPORT ToplevelWindowEventFilter :
// Return value is returned by OnMouseEvent() above.
bool HandleMouseExited(aura::Window* target, ui::LocatedEvent* event);
+ // Invoked from ScopedWindowResizer if the window is destroyed.
+ void ResizerWindowDestroyed();
+
// Are we running a nested message loop from RunMoveLoop().
bool in_move_loop_;
@@ -94,7 +103,7 @@ class ASH_EXPORT ToplevelWindowEventFilter :
// See description above setter.
int grid_size_;
- scoped_ptr<WindowResizer> window_resizer_;
+ scoped_ptr<ScopedWindowResizer> window_resizer_;
base::Closure quit_closure_;
« no previous file with comments | « ash/wm/default_window_resizer.cc ('k') | ash/wm/toplevel_window_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698