Chromium Code Reviews| 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..fe14556ea8ec1f6d1f24420cd374151963b29d51 100644 |
| --- a/ui/aura_shell/default_container_event_filter.cc |
| +++ b/ui/aura_shell/default_container_event_filter.cc |
| @@ -26,6 +26,9 @@ bool DefaultContainerEventFilter::PreHandleMouseEvent(aura::Window* target, |
| static_cast<DefaultContainerLayoutManager*>(owner()->layout_manager()); |
| DCHECK(layout_manager); |
| + // TODO(oshima|sky): Move ToplevelWindowEventFilter to the shell, |
| + // incorporate the logic below and intorduce DragObserver to decouple DCLM. |
|
oshima
2011/10/26 22:48:03
I'll work on refactoring in separate CL
|
| + |
| // 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 +39,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_) { |
|
sky
2011/10/27 00:53:03
nit: 'switch(' -> 'switch ('
oshima
2011/10/27 16:16:27
Done.
|
| + case DRAG_NONE: |
| + if(!UpdateDragState()) |
|
sky
2011/10/27 00:53:03
nit: 'if(' -> 'if ('
oshima
2011/10/27 16:16:27
Done.
|
| + layout_manager->CancelMoveOrResize(target, event); |
| + break; |
| + case DRAG_MOVE: |
| + layout_manager->ProcessMove(target, event); |
| + break; |
| + case DRAG_RESIZE: |
| + break; |
|
sky
2011/10/27 00:53:03
default: NOTREACHED
oshima
2011/10/27 16:16:27
drag_state_ is enum and compilation fails if I don
|
| + }; |
|
sky
2011/10/27 00:53:03
no;
oshima
2011/10/27 16:16:27
Done.
|
| + } else { |
| layout_manager->CancelMoveOrResize(target, event); |
| + } |
| break; |
| case ui::ET_MOUSE_RELEASED: |
| if (drag_state_ == DRAG_MOVE) |