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

Unified Diff: remoting/client/gesture_interpreter.h

Issue 2862893003: [CRD iOS] Inject mouse events to the host (Closed)
Patch Set: Resolve Feedback Created 3 years, 7 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 | « remoting/client/direct_input_strategy.cc ('k') | remoting/client/gesture_interpreter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/gesture_interpreter.h
diff --git a/remoting/client/gesture_interpreter.h b/remoting/client/gesture_interpreter.h
index 5bad56792bd1863d1fb613e05a5abaf8f271cbd1..9ad968fff2353ef1e62c8ded65b05eee744deff2 100644
--- a/remoting/client/gesture_interpreter.h
+++ b/remoting/client/gesture_interpreter.h
@@ -5,29 +5,49 @@
#ifndef REMOTING_CLIENT_GESTURE_INTERPRETER_H_
#define REMOTING_CLIENT_GESTURE_INTERPRETER_H_
+#include <memory>
+
+#include "remoting/client/chromoting_session.h"
#include "remoting/client/desktop_viewport.h"
+#include "remoting/proto/event.pb.h"
namespace remoting {
+class InputStrategy;
+
// This is a class for interpreting a raw touch input into actions like moving
// the viewport and injecting mouse clicks.
class GestureInterpreter {
public:
+ enum GestureState { GESTURE_BEGAN, GESTURE_CHANGED, GESTURE_ENDED };
+
GestureInterpreter(
- const DesktopViewport::TransformationCallback& on_transformation_changed);
+ const DesktopViewport::TransformationCallback& on_transformation_changed,
+ ChromotingSession* input_stub);
~GestureInterpreter();
// Coordinates of the OpenGL view surface will be used.
void Pinch(float pivot_x, float pivot_y, float scale);
void Pan(float translation_x, float translation_y);
void Tap(float x, float y);
- void LongPress(float x, float y);
+ void TwoFingerTap(float x, float y);
+
+ // Caller is expected to call both Pan() and LongPress() when long-press is in
+ // progress.
+ void LongPress(float x, float y, GestureState state);
void OnSurfaceSizeChanged(int width, int height);
void OnDesktopSizeChanged(int width, int height);
private:
+ void InjectMouseClick(float x,
+ float y,
+ protocol::MouseEvent_MouseButton button);
+
+ std::unique_ptr<InputStrategy> input_strategy_;
DesktopViewport viewport_;
+ ChromotingSession* input_stub_;
+ bool is_dragging_mode_ = false;
// GestureInterpreter is neither copyable nor movable.
GestureInterpreter(const GestureInterpreter&) = delete;
« no previous file with comments | « remoting/client/direct_input_strategy.cc ('k') | remoting/client/gesture_interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698