summaryrefslogtreecommitdiffstats
path: root/content/browser/android/touch_point.h
blob: d7caac08764260fdbaa3b00f2592b844d5e5d8b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_ANDROID_TOUCH_POINT_H_
#define CONTENT_BROWSER_ANDROID_TOUCH_POINT_H_

#include <jni.h>

#include "third_party/WebKit/public/web/WebInputEvent.h"

namespace content {

// This class provides a helper method to convert a java object array of touch
// events (in physical pixdels) into a blink::WebTouchEvent (in dip).
class TouchPoint {
 public:
  static void BuildWebTouchEvent(JNIEnv* env,
                                 jint type,
                                 jlong time_ms,
                                 float dpi_scale,
                                 jobjectArray pts,
                                 blink::WebTouchEvent& event);
};

bool RegisterTouchPoint(JNIEnv* env);

}  // namespace content

#endif  // CONTENT_BROWSER_ANDROID_CHROME_VIEW_H_