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

Side by Side Diff: content/browser/renderer_host/input/synthetic_gesture_target_base.cc

Issue 2250233002: Type->String helper function added to WebInputEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Blink_Common_export instead of blink_export Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input/synthetic_gesture_target_base.h" 5 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
6 6
7 #include "content/browser/renderer_host/render_widget_host_impl.h" 7 #include "content/browser/renderer_host/render_widget_host_impl.h"
8 #include "content/browser/renderer_host/render_widget_host_view_base.h" 8 #include "content/browser/renderer_host/render_widget_host_view_base.h"
9 #include "content/browser/renderer_host/ui_events_helper.h" 9 #include "content/browser/renderer_host/ui_events_helper.h"
10 #include "content/common/input_messages.h" 10 #include "content/common/input_messages.h"
(...skipping 26 matching lines...) Expand all
37 RenderWidgetHostImpl* host) 37 RenderWidgetHostImpl* host)
38 : host_(host) { 38 : host_(host) {
39 DCHECK(host); 39 DCHECK(host);
40 } 40 }
41 41
42 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() { 42 SyntheticGestureTargetBase::~SyntheticGestureTargetBase() {
43 } 43 }
44 44
45 void SyntheticGestureTargetBase::DispatchInputEventToPlatform( 45 void SyntheticGestureTargetBase::DispatchInputEventToPlatform(
46 const WebInputEvent& event) { 46 const WebInputEvent& event) {
47 TRACE_EVENT1("input", 47 TRACE_EVENT1("input", "SyntheticGestureTarget::DispatchInputEventToPlatform",
48 "SyntheticGestureTarget::DispatchInputEventToPlatform", 48 "type", WebInputEvent::GetName(event.type));
49 "type", ui::WebInputEventTraits::GetName(event.type));
50 49
51 ui::LatencyInfo latency_info; 50 ui::LatencyInfo latency_info;
52 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); 51 latency_info.AddLatencyNumber(ui::INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
53 52
54 if (WebInputEvent::isTouchEventType(event.type)) { 53 if (WebInputEvent::isTouchEventType(event.type)) {
55 const WebTouchEvent& web_touch = 54 const WebTouchEvent& web_touch =
56 static_cast<const WebTouchEvent&>(event); 55 static_cast<const WebTouchEvent&>(event);
57 56
58 // Check that all touch pointers are within the content bounds. 57 // Check that all touch pointers are within the content bounds.
59 for (unsigned i = 0; i < web_touch.touchesLength; i++) 58 for (unsigned i = 0; i < web_touch.touchesLength; i++)
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 return 0.0f; 126 return 0.0f;
128 } 127 }
129 128
130 bool SyntheticGestureTargetBase::PointIsWithinContents(int x, int y) const { 129 bool SyntheticGestureTargetBase::PointIsWithinContents(int x, int y) const {
131 gfx::Rect bounds = host_->GetView()->GetViewBounds(); 130 gfx::Rect bounds = host_->GetView()->GetViewBounds();
132 bounds -= bounds.OffsetFromOrigin(); // Translate the bounds to (0,0). 131 bounds -= bounds.OffsetFromOrigin(); // Translate the bounds to (0,0).
133 return bounds.Contains(x, y); 132 return bounds.Contains(x, y);
134 } 133 }
135 134
136 } // namespace content 135 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698