Chromium Code Reviews| Index: ash/wm/workspace/workspace_event_handler.cc |
| diff --git a/ash/wm/workspace/workspace_event_handler.cc b/ash/wm/workspace/workspace_event_handler.cc |
| index bcd7e9e1d642bc6a238e7217bf8d47cd080108b3..374234e41f4ae0f8528b1b587152175900e6c66d 100644 |
| --- a/ash/wm/workspace/workspace_event_handler.cc |
| +++ b/ash/wm/workspace/workspace_event_handler.cc |
| @@ -54,8 +54,7 @@ void ToggleMaximizedState(wm::WindowState* window_state) { |
| namespace internal { |
| -WorkspaceEventHandler::WorkspaceEventHandler(aura::Window* owner) |
| - : ToplevelWindowEventHandler(owner) { |
| +WorkspaceEventHandler::WorkspaceEventHandler() { |
| } |
| WorkspaceEventHandler::~WorkspaceEventHandler() { |
| @@ -79,10 +78,8 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
| case ui::ET_MOUSE_PRESSED: { |
| // Maximize behavior is implemented as post-target handling so the target |
| // can cancel it. |
| - if (ui::EventCanceledDefaultHandling(*event)) { |
| - ToplevelWindowEventHandler::OnMouseEvent(event); |
| + if (ui::EventCanceledDefaultHandling(*event)) |
| return; |
| - } |
| wm::WindowState* target_state = wm::GetWindowState(target); |
| if (event->flags() & ui::EF_IS_DOUBLE_CLICK && |
| event->IsOnlyLeftMouseButton() && |
| @@ -91,6 +88,7 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
| ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); |
| ToggleMaximizedState(target_state); |
| + event->StopPropagation(); |
| } |
| multi_window_resize_controller_.Hide(); |
| HandleVerticalResizeDoubleClick(target_state, event); |
| @@ -99,7 +97,6 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
| default: |
| break; |
| } |
| - ToplevelWindowEventHandler::OnMouseEvent(event); |
| } |
| void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
| @@ -123,7 +120,6 @@ void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { |
| TouchUMA::GESTURE_FRAMEVIEW_TAP); |
| } |
| } |
| - ToplevelWindowEventHandler::OnGestureEvent(event); |
| } |
| void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
| @@ -145,6 +141,7 @@ void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
| target->bounds().y() == work_area.y())) { |
| SingleAxisUnmaximize(target_state, |
| target_state->GetRestoreBoundsInScreen()); |
| + event->StopPropagation(); |
| } else { |
| gfx::Point origin = target->bounds().origin(); |
| wm::ConvertPointToScreen(target->parent(), &origin); |
| @@ -153,6 +150,7 @@ void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
| work_area.y(), |
| target->bounds().width(), |
| work_area.height())); |
| + event->StopPropagation(); |
| } |
|
oshima
2013/12/17 00:33:46
can't you just call StopPropagation here once?
|
| } else if (component == HTLEFT || component == HTRIGHT) { |
| // Don't maximize horizontally if the window has a max width defined. |
| @@ -163,6 +161,7 @@ void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
| target->bounds().x() == work_area.x())) { |
| SingleAxisUnmaximize(target_state, |
| target_state->GetRestoreBoundsInScreen()); |
| + event->StopPropagation(); |
| } else { |
| gfx::Point origin = target->bounds().origin(); |
| wm::ConvertPointToScreen(target->parent(), &origin); |
| @@ -171,6 +170,7 @@ void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( |
| origin.y(), |
| work_area.width(), |
| target->bounds().height())); |
| + event->StopPropagation(); |
| } |
|
oshima
2013/12/17 00:33:46
ditto
|
| } |
| } |