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

Side by Side Diff: content/browser/renderer_host/render_widget_host_input_event_router.cc

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Rebase to master@{#445291}. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 5 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 10
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 break; 352 break;
353 } 353 }
354 case blink::WebInputEvent::TouchMove: 354 case blink::WebInputEvent::TouchMove:
355 if (touch_target_.target) { 355 if (touch_target_.target) {
356 TransformEventTouchPositions(event, touch_target_.delta); 356 TransformEventTouchPositions(event, touch_target_.delta);
357 touch_target_.target->ProcessTouchEvent(*event, latency); 357 touch_target_.target->ProcessTouchEvent(*event, latency);
358 } 358 }
359 break; 359 break;
360 case blink::WebInputEvent::TouchEnd: 360 case blink::WebInputEvent::TouchEnd:
361 case blink::WebInputEvent::TouchCancel: 361 case blink::WebInputEvent::TouchCancel:
362 // It might be safer to test active_touches_ and only decrement it if it's
363 // non-zero, since active_touches_ can be reset to 0 in
364 // OnRenderWidgetHostViewBaseDestroyed, and this can happen between the
365 // TouchStart and a subsequent TouchMove/End/Cancel.
362 DCHECK(active_touches_); 366 DCHECK(active_touches_);
363 active_touches_ -= CountChangedTouchPoints(*event); 367 active_touches_ -= CountChangedTouchPoints(*event);
364 if (!touch_target_.target) 368 if (!touch_target_.target)
365 return; 369 return;
366 370
367 TransformEventTouchPositions(event, touch_target_.delta); 371 TransformEventTouchPositions(event, touch_target_.delta);
368 touch_target_.target->ProcessTouchEvent(*event, latency); 372 touch_target_.target->ProcessTouchEvent(*event, latency);
369 if (!active_touches_) 373 if (!active_touches_)
370 touch_target_.target = nullptr; 374 touch_target_.target = nullptr;
371 break; 375 break;
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 if (!touchpad_gesture_target_.target) 779 if (!touchpad_gesture_target_.target)
776 return; 780 return;
777 781
778 // TODO(mohsen): Add tests to check event location. 782 // TODO(mohsen): Add tests to check event location.
779 event->x += touchpad_gesture_target_.delta.x(); 783 event->x += touchpad_gesture_target_.delta.x();
780 event->y += touchpad_gesture_target_.delta.y(); 784 event->y += touchpad_gesture_target_.delta.y();
781 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency); 785 touchpad_gesture_target_.target->ProcessGestureEvent(*event, latency);
782 } 786 }
783 787
784 } // namespace content 788 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.h ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698