Commit b8e78518 authored by pkotwicz@chromium.org's avatar pkotwicz@chromium.org

ToplevelWindowEventHandler::HandleMousePressed() has some comments about only...

ToplevelWindowEventHandler::HandleMousePressed() has some comments about only handling events post target. Those comments are untrue so remove them.
It is also non trivial to get the originally desired behavior, namely getting mouse events to HTML elements with the "-webkit-app-region" CSS style applied. 

BUG=None
TEST=None

Review URL: https://codereview.chromium.org/108723008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243439 0039d316-1c4b-4281-b951-d872f2087c98
parent 853f8ea5
...@@ -386,9 +386,7 @@ void ToplevelWindowEventHandler::CompleteDrag(DragCompletionStatus status) { ...@@ -386,9 +386,7 @@ void ToplevelWindowEventHandler::CompleteDrag(DragCompletionStatus status) {
void ToplevelWindowEventHandler::HandleMousePressed( void ToplevelWindowEventHandler::HandleMousePressed(
aura::Window* target, aura::Window* target,
ui::MouseEvent* event) { ui::MouseEvent* event) {
// Move/size operations are initiated post-target handling to give the target if (event->phase() != ui::EP_PRETARGET)
// an opportunity to cancel this default behavior by returning ER_HANDLED.
if (ui::EventCanceledDefaultHandling(*event))
return; return;
// We also update the current window component here because for the // We also update the current window component here because for the
......
...@@ -77,12 +77,6 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { ...@@ -77,12 +77,6 @@ void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
case ui::ET_MOUSE_EXITED: case ui::ET_MOUSE_EXITED:
break; break;
case ui::ET_MOUSE_PRESSED: { 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);
return;
}
wm::WindowState* target_state = wm::GetWindowState(target); wm::WindowState* target_state = wm::GetWindowState(target);
if (event->flags() & ui::EF_IS_DOUBLE_CLICK && if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
event->IsOnlyLeftMouseButton() && event->IsOnlyLeftMouseButton() &&
......
...@@ -16,10 +16,6 @@ namespace { ...@@ -16,10 +16,6 @@ namespace {
int g_custom_event_types = ET_LAST; int g_custom_event_types = ET_LAST;
} // namespace } // namespace
bool EventCanceledDefaultHandling(const Event& event) {
return event.phase() == EP_POSTTARGET && event.result() != ER_UNHANDLED;
}
int RegisterCustomEventType() { int RegisterCustomEventType() {
return ++g_custom_event_types; return ++g_custom_event_types;
} }
......
...@@ -158,10 +158,6 @@ EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam); ...@@ -158,10 +158,6 @@ EVENTS_EXPORT uint16 GetScanCodeFromLParam(LPARAM lParam);
EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code); EVENTS_EXPORT LPARAM GetLParamFromScanCode(uint16 scan_code);
#endif #endif
// Returns true if default post-target handling was canceled for |event| after
// its dispatch to its target.
EVENTS_EXPORT bool EventCanceledDefaultHandling(const Event& event);
// Registers a custom event type. // Registers a custom event type.
EVENTS_EXPORT int RegisterCustomEventType(); EVENTS_EXPORT int RegisterCustomEventType();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment