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

Unified Diff: ui/aura_shell/default_container_event_filter.cc

Issue 8391035: Drag and rotate windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment Created 9 years, 2 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 | ui/aura_shell/default_container_layout_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/default_container_event_filter.cc
diff --git a/ui/aura_shell/default_container_event_filter.cc b/ui/aura_shell/default_container_event_filter.cc
index 954714843fa402370770fed5c3ee6cd01f50d7cd..e06aa0b19008ea06df98bd67dfa104c055c3611b 100644
--- a/ui/aura_shell/default_container_event_filter.cc
+++ b/ui/aura_shell/default_container_event_filter.cc
@@ -26,6 +26,10 @@ bool DefaultContainerEventFilter::PreHandleMouseEvent(aura::Window* target,
static_cast<DefaultContainerLayoutManager*>(owner()->layout_manager());
DCHECK(layout_manager);
+ // TODO(oshima|derat): Move ToplevelWindowEventFilter to the shell,
+ // incorporate the logic below and intorduce DragObserver (or something
+ // similar) to decouple DCLM.
+
// Notify layout manager that drag event may move/resize the target wnidow.
if (event->type() == ui::ET_MOUSE_DRAGGED && drag_state_ == DRAG_NONE)
layout_manager->PrepareForMoveOrResize(target, event);
@@ -36,8 +40,21 @@ bool DefaultContainerEventFilter::PreHandleMouseEvent(aura::Window* target,
case ui::ET_MOUSE_DRAGGED:
// Cancel move/resize if the event wasn't handled, or
// drag_state_ didn't move to MOVE or RESIZE.
- if (!handled || (drag_state_ == DRAG_NONE && !UpdateDragState()))
+ if (handled) {
+ switch (drag_state_) {
+ case DRAG_NONE:
+ if (!UpdateDragState())
+ layout_manager->CancelMoveOrResize(target, event);
+ break;
+ case DRAG_MOVE:
+ layout_manager->ProcessMove(target, event);
+ break;
+ case DRAG_RESIZE:
+ break;
+ }
+ } else {
layout_manager->CancelMoveOrResize(target, event);
+ }
break;
case ui::ET_MOUSE_RELEASED:
if (drag_state_ == DRAG_MOVE)
« no previous file with comments | « no previous file | ui/aura_shell/default_container_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698