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

Unified Diff: ash/wm/workspace/workspace_event_filter.cc

Issue 10857021: Prepare a bunch of ash tests for workspace2. With Workspace2 you can't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/workspace/workspace_event_filter.h ('k') | ash/wm/workspace/workspace_event_filter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_event_filter.cc
diff --git a/ash/wm/workspace/workspace_event_filter.cc b/ash/wm/workspace/workspace_event_filter.cc
index 8c9cb3cea891c1a27bc0eecc1fa4d3eec91d360c..8b64a629c3a07c241282ac14ac593a690f5a3989 100644
--- a/ash/wm/workspace/workspace_event_filter.cc
+++ b/ash/wm/workspace/workspace_event_filter.cc
@@ -8,7 +8,6 @@
#include "ash/wm/property_util.h"
#include "ash/wm/window_frame.h"
#include "ash/wm/window_util.h"
-#include "ash/wm/workspace/workspace_layout_manager.h"
#include "ash/wm/workspace/workspace_window_resizer.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
@@ -69,10 +68,13 @@ namespace internal {
WorkspaceEventFilter::WorkspaceEventFilter(aura::Window* owner)
: ToplevelWindowEventFilter(owner),
- hovered_window_(NULL) {
+ hovered_window_(NULL),
+ destroyed_(NULL) {
}
WorkspaceEventFilter::~WorkspaceEventFilter() {
+ if (destroyed_)
+ *destroyed_ = true;
if (hovered_window_)
hovered_window_->RemoveObserver(this);
}
@@ -95,14 +97,21 @@ bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target,
case ui::ET_MOUSE_EXITED:
UpdateHoveredWindow(NULL);
break;
- case ui::ET_MOUSE_PRESSED:
+ case ui::ET_MOUSE_PRESSED: {
if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
target->delegate()->GetNonClientComponent(event->location()) ==
- HTCAPTION)
+ HTCAPTION) {
+ bool destroyed = false;
+ destroyed_ = &destroyed;
ToggleMaximizedState(target);
+ if (destroyed)
+ return false;
+ destroyed_ = NULL;
+ }
multi_window_resize_controller_.Hide();
HandleVerticalResizeDoubleClick(target, event);
break;
+ }
default:
break;
}
« no previous file with comments | « ash/wm/workspace/workspace_event_filter.h ('k') | ash/wm/workspace/workspace_event_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698