Commit 1126746c authored by dtapuska's avatar dtapuska Committed by Commit bot

Turn MoveLeave event sending into a feature for testing enabling it.

Don't change the current implementation but enable the ability to
adjust the mouse leave event sending dynamically.

BUG=450631

Review-Url: https://codereview.chromium.org/2614163002
Cr-Commit-Position: refs/heads/master@{#442025}
parent cec11b6f
......@@ -11,4 +11,14 @@ namespace features {
const base::Feature kVsyncAlignedInputEvents{"VsyncAlignedInput",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kSendMouseLeaveEvents {
"SendMouseLeaveEvents",
// TODO(chaopeng) this fix only for chromeos now, should convert ET_MOUSE_EXITED
// to MouseLeave when crbug.com/450631 fixed.
#if defined(OS_CHROMEOS)
base::FEATURE_ENABLED_BY_DEFAULT
#else
base::FEATURE_DISABLED_BY_DEFAULT
#endif
};
}
......@@ -11,6 +11,11 @@ namespace features {
extern const base::Feature kVsyncAlignedInputEvents;
// This feature allows native ET_MOUSE_EXIT events to be passed
// through to blink as mouse leave events. Traditionally these events were
// converted to mouse move events due to a number of incosistencies on
// the native platforms. Enabled by default on ChromeOS. crbug.com/450631
extern const base::Feature kSendMouseLeaveEvents;
}
#endif // UI_EVENTS_BLINK_BLINK_FEATURES_H_
......@@ -6,6 +6,7 @@
#include "ui/events/base_event_utils.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/blink/blink_features.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
......@@ -385,13 +386,13 @@ blink::WebMouseEvent MakeWebMouseEventFromUiEvent(const MouseEvent& event) {
type = blink::WebInputEvent::MouseUp;
click_count = event.GetClickCount();
break;
case ET_MOUSE_EXITED:
// TODO(chaopeng) this fix only for chromeos now, should convert ET_MOUSE_EXITED
// to MouseLeave when crbug.com/450631 fixed.
#if defined(OS_CHROMEOS)
type = blink::WebInputEvent::MouseLeave;
case ET_MOUSE_EXITED: {
static bool s_send_leave =
base::FeatureList::IsEnabled(features::kSendMouseLeaveEvents);
type = s_send_leave ? blink::WebInputEvent::MouseLeave
: blink::WebInputEvent::MouseMove;
break;
#endif
}
case ET_MOUSE_ENTERED:
case ET_MOUSE_MOVED:
case ET_MOUSE_DRAGGED:
......
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