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

Side by Side 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: fix build error. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_
6 #define BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_
7
8 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_checker.h"
11 #include "ui/events/blink/input_handler_proxy.h"
12 #include "ui/events/blink/input_handler_proxy_client.h"
13
14 namespace blimp {
15 class BlimpInputManager;
16
17 // The BlimpInputHandlerWrapper isolates all input handling processing done on
18 // the compositor thread from the BlimpInputManager. It takes web input events
19 // from the BlimpInputManager and sends them to the ui::InputHandlerProxy.
20 // The class is created and lives on the compositor thread.
21 class BlimpInputHandlerWrapper : public ui::InputHandlerProxyClient {
22 public:
23 BlimpInputHandlerWrapper(
24 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner,
25 const base::WeakPtr<BlimpInputManager> input_manager_weak_ptr,
26 cc::InputHandler* input_handler);
27
28 ~BlimpInputHandlerWrapper() override;
29
30 // Called by the BlimpInputManager to process a web input event. This will
31 // call BlimpInputManager::HandleWebInputEvent with the result on the main
32 // thread.
33 void HandleWebInputEvent(const blink::WebInputEvent& input_event);
34
35 private:
36 // InputHandlerProxyClient implementation.
37 void WillShutdown() override;
38 void TransferActiveWheelFlingAnimation(
39 const blink::WebActiveWheelFlingParameters& params) override;
40 blink::WebGestureCurve* CreateFlingAnimationCurve(
41 blink::WebGestureDevice device_source,
42 const blink::WebFloatPoint& velocity,
43 const blink::WebSize& cumulative_scroll) override;
44 void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll,
45 const gfx::Vector2dF& latest_overscroll_delta,
46 const gfx::Vector2dF& current_fling_velocity,
47 const gfx::PointF& causal_event_viewport_point) override;
48 void DidStopFlinging() override;
49 void DidAnimateForInput() override;
50
51 base::ThreadChecker compositor_thread_checker_;
52
53 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
54
55 // Used to queue calls to the BlimpInputManager to be run on the main
56 // thread. This ensures that any tasks queued are abandoned after the
57 // BlimpInputManager is destroyed.
58 base::WeakPtr<BlimpInputManager> input_manager_weak_ptr_;
59
60 scoped_ptr<ui::InputHandlerProxy> input_handler_proxy_;
61
62 DISALLOW_COPY_AND_ASSIGN(BlimpInputHandlerWrapper);
63 };
64
65 } // namespace blimp
66
67 #endif // BLIMP_CLIENT_INPUT_BLIMP_INPUT_HANDLER_WRAPPER_H_
OLDNEW
« no previous file with comments | « blimp/client/compositor/blimp_compositor.cc ('k') | blimp/client/input/blimp_input_handler_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698