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

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

Issue 114643003: Use a single ToplevelWindowEventHandler for the ash::Shell (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
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
}
}

Powered by Google App Engine
This is Rietveld 408576698