Random Cleanup: Floating keyboard dragging code
Was trying to fix something in this code for an unrelated bug and came across a few things that could be improved: * There were too many stateful booleans making the code unnecessarily complex. * The type of event that initialized the drag should be in the DragDescriptor, because it describes the drag and also has the same life cycle. * Flatten complicated if statements into chains of if/else's that only use simple conditions. * Use a switch statement for the event type. Change-Id: I74712df2502960c6a98be0a705a5ced94a61ec75 Reviewed-on: https://chromium-review.googlesource.com/979378Reviewed-by:Yuichiro Hanada <yhanada@chromium.org> Commit-Queue: Blake O'Hare <blakeo@chromium.org> Cr-Commit-Position: refs/heads/master@{#545737}
Showing
Please register or sign in to comment