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

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

Issue 9113045: Reworks the workspace code. Here's the new heuristics: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged and all that good stuff. Created 8 years, 11 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_layout_manager.h » ('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 66aecb491bf3f4ad369759fe38b7e5aafe6d8705..0988e2bee61f2ae500b38d6a55fbad19d9af56ba 100644
--- a/ash/wm/workspace/workspace_event_filter.cc
+++ b/ash/wm/workspace/workspace_event_filter.cc
@@ -38,6 +38,8 @@ WorkspaceEventFilter::WorkspaceEventFilter(aura::Window* owner)
}
WorkspaceEventFilter::~WorkspaceEventFilter() {
+ if (hovered_window_)
+ hovered_window_->RemoveObserver(this);
}
bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target,
@@ -95,6 +97,12 @@ bool WorkspaceEventFilter::PreHandleMouseEvent(aura::Window* target,
return handled;
}
+void WorkspaceEventFilter::OnWindowDestroyed(aura::Window* window) {
+ DCHECK_EQ(hovered_window_, window);
+ hovered_window_->RemoveObserver(this);
+ hovered_window_ = NULL;
+}
+
bool WorkspaceEventFilter::UpdateDragState() {
DCHECK_EQ(DRAG_NONE, drag_state_);
switch (window_component()) {
@@ -122,9 +130,13 @@ void WorkspaceEventFilter::UpdateHoveredWindow(
aura::Window* toplevel_window) {
if (toplevel_window == hovered_window_)
return;
+ if (hovered_window_)
+ hovered_window_->RemoveObserver(this);
WindowHoverChanged(hovered_window_, false);
hovered_window_ = toplevel_window;
WindowHoverChanged(hovered_window_, true);
+ if (hovered_window_)
+ hovered_window_->AddObserver(this);
}
} // namespace internal
« no previous file with comments | « ash/wm/workspace/workspace_event_filter.h ('k') | ash/wm/workspace/workspace_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698