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

Unified Diff: ash/wm/toplevel_window_event_handler.cc

Issue 222203006: Prevents double-clicks on a tab close button from aslo maximizing the browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
Index: ash/wm/toplevel_window_event_handler.cc
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index 8b6c9ba04542badc4444a7dc5fdb951afd4540a4..0dc31909abf9e5da120a05c7b8b68cc67ed64d40 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -476,7 +476,10 @@ void ToplevelWindowEventHandler::HandleMousePressed(
ConvertPointToParent(target, event->location()));
AttemptToStartDrag(target, location_in_parent, component,
aura::client::WINDOW_MOVE_SOURCE_MOUSE);
- event->StopPropagation();
+ // Set as handled so that other event handlers do no act upon the event
+ // but still receive it so that they receive both parts of each pressed/
+ // released pair.
+ event->SetHandled();
} else {
CompleteDrag(DRAG_COMPLETE);
}
@@ -491,12 +494,13 @@ void ToplevelWindowEventHandler::HandleMouseReleased(
CompleteDrag(event->type() == ui::ET_MOUSE_RELEASED ?
DRAG_COMPLETE : DRAG_REVERT);
// Completing the drag may result in hiding the window. If this happens
- // return true so no other handlers/observers see the event. Otherwise
- // they see the event on a hidden window.
+ // make the event as handled so no other handlers/observers act upon the
flackr 2014/04/12 03:27:46 s/make/mark
jonross 2014/04/14 18:36:15 Done.
+ // event. They should see the event on a hidden window, to determine targets
+ // of destructive actions such as hidding. They should not act upon them.
flackr 2014/04/12 03:27:46 s/hidding/hiding
jonross 2014/04/14 18:36:15 Done.
if (window_resizer_ &&
event->type() == ui::ET_MOUSE_CAPTURE_CHANGED &&
!target->IsVisible()) {
- event->StopPropagation();
+ event->SetHandled();
}
}
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_event_handler.h » ('j') | ash/wm/workspace/workspace_event_handler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698