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

Unified Diff: content/browser/renderer_host/input/synthetic_pointer_action_controller.h

Issue 2336803003: Make SyntheticPointerAction to flush the pointer action sequence (Closed)
Patch Set: controller Created 4 years, 2 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
Index: content/browser/renderer_host/input/synthetic_pointer_action_controller.h
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action_controller.h b/content/browser/renderer_host/input/synthetic_pointer_action_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..965eed8c3f32a339a52535dc01bee7926c321877
--- /dev/null
+++ b/content/browser/renderer_host/input/synthetic_pointer_action_controller.h
@@ -0,0 +1,52 @@
+// 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_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_CONTROLLER_H_
+#define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_CONTROLLER_H_
+
+#include "content/browser/renderer_host/input/synthetic_pointer.h"
+#include "content/browser/renderer_host/input/synthetic_pointer_action.h"
+#include "content/common/content_export.h"
+#include "content/common/input/synthetic_pointer_action_list_params.h"
+
+namespace content {
+
+class CONTENT_EXPORT SyntheticPointerActionController {
+ public:
+ SyntheticPointerActionController();
+ ~SyntheticPointerActionController();
+
+ std::unique_ptr<SyntheticGesture> CreateSyntheticPointerAction(
+ const SyntheticPointerActionListParams& gesture_params);
+
+ void ResetSyntheticPointer();
+
+ void SetDefaultGestureSourceType(
+ SyntheticGestureParams::GestureSourceType default_type);
+
+ private:
+ friend class TestSyntheticGestureController;
+
+ void SetSyntheticPointer(
+ const SyntheticPointerActionListParams& gesture_params);
+
+ // A list of all the action parameters, which should be executed in the
+ // same frame.
+ std::unique_ptr<SyntheticPointerActionListParams> action_list_param_;
+ // For one pointer action sequence, we should use the same SyntheticPointer
+ // object, and keep the states for all touch points.
+ std::unique_ptr<SyntheticPointer> synthetic_pointer_;
+ // This is used to map the indexes of touch points between the ones that are
+ // part of the arguments to PointerAction API and the real indexes kept in
+ // the touch event we will dispatch to the renderer.
+ SyntheticPointerAction::IndexMap index_map_;
+
+ SyntheticGestureParams::GestureSourceType default_type_;
+
+ DISALLOW_COPY_AND_ASSIGN(SyntheticPointerActionController);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698