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

Unified Diff: content/browser/android/joystick_scroll_provider.h

Issue 2548363007: Emulate Android joystick scroll with synthetic mouse wheel event (Closed)
Patch Set: Fixed tests Created 4 years 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
Index: content/browser/android/joystick_scroll_provider.h
diff --git a/content/browser/android/joystick_scroll_provider.h b/content/browser/android/joystick_scroll_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..ab9c72d971ecd87f4882de9bc1d07cfa87808075
--- /dev/null
+++ b/content/browser/android/joystick_scroll_provider.h
@@ -0,0 +1,44 @@
+// Copyright 2016 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_JOYSTICK_SCROLL_PROVIDER_H_
+#define CONTENT_BROWSER_ANDROID_JOYSTICK_SCROLL_PROVIDER_H_
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_weak_ref.h"
+
+namespace content {
+
+class WebContentsImpl;
+
+class JoystickScrollProvider {
+ public:
+ JoystickScrollProvider(JNIEnv* env,
+ const base::android::JavaRef<jobject>& obj,
+ WebContentsImpl* web_contents);
+
+ ~JoystickScrollProvider();
+
+ void ScrollBy(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong time_ms,
+ jfloat dx_dip,
+ jfloat dy_dip);
+
+ private:
+ class UserData;
+
+ // A weak reference to the Java JoystickScrollProvider object.
+ JavaObjectWeakGlobalRef java_ref_;
+
+ WebContentsImpl* web_contents_;
+
+ DISALLOW_COPY_AND_ASSIGN(JoystickScrollProvider);
+};
+
+bool RegisterJoystickScrollProvider(JNIEnv* env);
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_ANDROID_JOYSTICK_SCROLL_PROVIDER_H_
« no previous file with comments | « content/browser/android/browser_jni_registrar.cc ('k') | content/browser/android/joystick_scroll_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698