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

Unified Diff: components/mus/display_manager.cc

Issue 1313353010: Overhaul Mandoline event transport code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed gn check Created 5 years, 3 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
« no previous file with comments | « components/html_viewer/touch_handler.cc ('k') | components/mus/event_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/display_manager.cc
diff --git a/components/mus/display_manager.cc b/components/mus/display_manager.cc
index 6cd305b1c5d7a3938ed7c571a85aab02cea67c6f..195d5a138e3f83ccfd862abccdfe004256e96109 100644
--- a/components/mus/display_manager.cc
+++ b/components/mus/display_manager.cc
@@ -81,15 +81,6 @@ void DrawViewTree(cc::RenderPass* pass,
bounds_at_origin /* visible_rect */, view->surface_id());
}
-float ConvertUIWheelValueToMojoValue(int offset) {
- // Mojo's event type takes a value between -1 and 1. Normalize by allowing
- // up to 20 of ui's offset. This is a bit arbitrary.
- return std::max(
- -1.0f, std::min(1.0f, static_cast<float>(offset) /
- (20 * static_cast<float>(
- ui::MouseWheelEvent::kWheelDelta))));
-}
-
} // namespace
// static
@@ -266,16 +257,6 @@ void DefaultDisplayManager::OnDamageRect(const gfx::Rect& damaged_region) {
void DefaultDisplayManager::DispatchEvent(ui::Event* event) {
mojo::EventPtr mojo_event(mojo::Event::From(*event));
- if (event->IsMouseWheelEvent()) {
- // Mojo's event type has a different meaning for wheel events. Convert
- // between the two.
- ui::MouseWheelEvent* wheel_event = static_cast<ui::MouseWheelEvent*>(event);
- DCHECK(mojo_event->pointer_data);
- mojo_event->pointer_data->horizontal_wheel =
- ConvertUIWheelValueToMojoValue(wheel_event->x_offset());
- mojo_event->pointer_data->horizontal_wheel =
- ConvertUIWheelValueToMojoValue(wheel_event->y_offset());
- }
delegate_->OnEvent(mojo_event.Pass());
switch (event->type()) {
« no previous file with comments | « components/html_viewer/touch_handler.cc ('k') | components/mus/event_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698