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

Unified Diff: blimp/client/input/blimp_input_handler_wrapper.h

Issue 1430623004: blimp: Add support for input handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move all input handling on compositor thread to BlimpInputHandlerWrapper. Created 5 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: blimp/client/input/blimp_input_handler_wrapper.h
diff --git a/blimp/client/input/blimp_input_handler_wrapper.h b/blimp/client/input/blimp_input_handler_wrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..e7b5e5a7173ea746d583c84387e85f3c7d30e60f
--- /dev/null
+++ b/blimp/client/input/blimp_input_handler_wrapper.h
@@ -0,0 +1,59 @@
+// Copyright 2011 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 BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_
+#define BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_
+
+#include "base/macros.h"
+#include "base/single_thread_task_runner.h"
+#include "base/threading/thread_checker.h"
+#include "ui/events/blink/input_handler_proxy.h"
+#include "ui/events/blink/input_handler_proxy_client.h"
+
+namespace blimp {
+class BlimpInputManager;
+
+// This class is created and lives on the compositor thread.
nyquist 2015/12/05 01:54:42 What is it used for? It owns a scoped_ptr to the I
Khushal 2015/12/07 23:01:22 Done.
+class BlimpInputHandlerWrapper : public ui::InputHandlerProxyClient {
+ public:
+ BlimpInputHandlerWrapper(
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
+ const base::WeakPtr<BlimpInputManager> input_manager_weak_ptr,
+ cc::InputHandler* input_handler);
+
+ void HandleWebInputEvent(const blink::WebInputEvent& input_event);
nyquist 2015/12/05 01:54:42 Who calls this? When should this be called? What i
Khushal 2015/12/07 23:01:22 Done.
+
+ private:
+ // InputHandlerProxyClient implementation.
+ void WillShutdown() override;
+ void TransferActiveWheelFlingAnimation(
+ const blink::WebActiveWheelFlingParameters& params) override;
+ blink::WebGestureCurve* CreateFlingAnimationCurve(
+ blink::WebGestureDevice device_source,
+ const blink::WebFloatPoint& velocity,
+ const blink::WebSize& cumulative_scroll) override;
+ void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll,
+ const gfx::Vector2dF& latest_overscroll_delta,
+ const gfx::Vector2dF& current_fling_velocity,
+ const gfx::PointF& causal_event_viewport_point) override;
+ void DidStopFlinging() override;
+ void DidAnimateForInput() override;
+
+ base::ThreadChecker compositor_thread_checker_;
+
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+
+ // Used to queue calls to the BlimpInputManager to be run on the main
+ // thread. This ensures that any tasks queued are abandoned after the
+ // BlimpInputManager is destroyed.
+ base::WeakPtr<BlimpInputManager> input_manager_weak_ptr_;
+
+ scoped_ptr<ui::InputHandlerProxy> input_handler_proxy_;
+
+ DISALLOW_COPY_AND_ASSIGN(BlimpInputHandlerWrapper);
+};
+
+} // namespace blimp
+
+#endif // BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698