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

Unified Diff: ash/wm/panel_window_event_filter.cc

Issue 11592011: events: Update mouse-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « ash/wm/panel_window_event_filter.h ('k') | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/panel_window_event_filter.cc
diff --git a/ash/wm/panel_window_event_filter.cc b/ash/wm/panel_window_event_filter.cc
index 52696aa90cc3a080dfa5a177d3435f43b107a090..3f5f0b402472821df15adf357f21c4111b989863 100644
--- a/ash/wm/panel_window_event_filter.cc
+++ b/ash/wm/panel_window_event_filter.cc
@@ -35,7 +35,7 @@ PanelWindowEventFilter::~PanelWindowEventFilter() {
panel_container_->RemovePreTargetHandler(this);
}
-ui::EventResult PanelWindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
+void PanelWindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
switch (event->type()) {
case ui::ET_MOUSE_PRESSED: {
@@ -46,13 +46,10 @@ ui::EventResult PanelWindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
dragged_panel_ = target;
drag_location_in_dragged_window_ = event->location();
drag_state_ = DRAG_CLICKED;
- return ui::ER_CONSUMED;
- } else {
- return ui::ER_UNHANDLED;
+ event->StopPropagation();
}
- } else {
- return ui::ER_UNHANDLED;
}
+ return;
}
case ui::ET_MOUSE_DRAGGED:
@@ -60,35 +57,34 @@ ui::EventResult PanelWindowEventFilter::OnMouseEvent(ui::MouseEvent* event) {
drag_state_ = DRAG_STARTED;
layout_manager_->StartDragging(dragged_panel_);
}
- if (drag_state_ == DRAG_STARTED)
- return HandleDrag(target, event) ? ui::ER_CONSUMED : ui::ER_UNHANDLED;
- else
- return ui::ER_UNHANDLED;
+ if (drag_state_ == DRAG_STARTED && HandleDrag(target, event))
+ event->StopPropagation();
+ return;
case ui::ET_MOUSE_CAPTURE_CHANGED:
if (drag_state_ == DRAG_STARTED) {
FinishDrag();
- return ui::ER_CONSUMED;
+ event->StopPropagation();
} else if (drag_state_ == DRAG_CLICKED) {
drag_state_ = DRAG_NONE;
dragged_panel_ = NULL;
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
- return ui::ER_UNHANDLED;
+ return;
case ui::ET_MOUSE_RELEASED:
if (drag_state_ == DRAG_STARTED) {
FinishDrag();
- return ui::ER_CONSUMED;
+ event->StopPropagation();
} else if (dragged_panel_ != NULL) {
drag_state_ = DRAG_NONE;
layout_manager_->ToggleMinimize(dragged_panel_);
dragged_panel_ = NULL;
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
- return ui::ER_UNHANDLED;
+ return;
default:
- return ui::ER_UNHANDLED;
+ return;
}
}
« no previous file with comments | « ash/wm/panel_window_event_filter.h ('k') | ash/wm/shelf_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698