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

Side by Side Diff: content/renderer/mus/compositor_mus_connection.h

Issue 2265393002: Refactor compositor event handling path to be callback-based (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tdresser's review Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 5 #ifndef CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 6 #define CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/common/input/input_event_ack_state.h"
12 #include "services/ui/public/cpp/input_event_handler.h" 13 #include "services/ui/public/cpp/input_event_handler.h"
13 #include "services/ui/public/cpp/window.h" 14 #include "services/ui/public/cpp/window.h"
14 #include "services/ui/public/cpp/window_tree_client.h" 15 #include "services/ui/public/cpp/window_tree_client.h"
15 #include "services/ui/public/cpp/window_tree_client_delegate.h" 16 #include "services/ui/public/cpp/window_tree_client_delegate.h"
16 #include "third_party/WebKit/public/web/WebInputEvent.h" 17 #include "third_party/WebKit/public/web/WebInputEvent.h"
18 #include "ui/events/blink/scoped_web_input_event.h"
17 #include "ui/events/gestures/motion_event_aura.h" 19 #include "ui/events/gestures/motion_event_aura.h"
18 20
19 namespace ui { 21 namespace ui {
20 struct DidOverscrollParams; 22 struct DidOverscrollParams;
21 } 23 }
22 24
23 namespace content { 25 namespace content {
24 26
25 class InputHandlerManager; 27 class InputHandlerManager;
26 28
(...skipping 29 matching lines...) Expand all
56 58
57 void AttachSurfaceOnCompositorThread( 59 void AttachSurfaceOnCompositorThread(
58 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding); 60 std::unique_ptr<ui::WindowSurfaceBinding> surface_binding);
59 61
60 void CreateWindowTreeClientOnCompositorThread( 62 void CreateWindowTreeClientOnCompositorThread(
61 ui::mojom::WindowTreeClientRequest request); 63 ui::mojom::WindowTreeClientRequest request);
62 64
63 void OnConnectionLostOnMainThread(); 65 void OnConnectionLostOnMainThread();
64 66
65 void OnWindowInputEventOnMainThread( 67 void OnWindowInputEventOnMainThread(
66 std::unique_ptr<blink::WebInputEvent> web_event, 68 ui::ScopedWebInputEvent web_event,
67 const base::Callback<void(ui::mojom::EventResult)>& ack); 69 const base::Callback<void(ui::mojom::EventResult)>& ack);
68 70
69 void OnWindowInputEventAckOnMainThread( 71 void OnWindowInputEventAckOnMainThread(
70 const base::Callback<void(ui::mojom::EventResult)>& ack, 72 const base::Callback<void(ui::mojom::EventResult)>& ack,
71 ui::mojom::EventResult result); 73 ui::mojom::EventResult result);
72 74
73 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event); 75 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event);
74 76
75 // WindowTreeClientDelegate implementation: 77 // WindowTreeClientDelegate implementation:
76 void OnDidDestroyClient(ui::WindowTreeClient* client) override; 78 void OnDidDestroyClient(ui::WindowTreeClient* client) override;
77 void OnEmbed(ui::Window* root) override; 79 void OnEmbed(ui::Window* root) override;
78 void OnPointerEventObserved(const ui::PointerEvent& event, 80 void OnPointerEventObserved(const ui::PointerEvent& event,
79 ui::Window* target) override; 81 ui::Window* target) override;
80 82
81 // InputEventHandler implementation: 83 // InputEventHandler implementation:
82 void OnWindowInputEvent( 84 void OnWindowInputEvent(
83 ui::Window* window, 85 ui::Window* window,
84 const ui::Event& event, 86 const ui::Event& event,
85 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* 87 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>*
86 ack_callback) override; 88 ack_callback) override;
89 void DidHandleWindowInputEventAndOverscroll(
90 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>
91 ack_callback,
92 InputEventAckState ack_state,
93 ui::ScopedWebInputEvent web_event,
94 const ui::LatencyInfo& latency_info,
95 std::unique_ptr<ui::DidOverscrollParams>);
Charlie Reis 2016/09/09 20:57:57 nit: Please name parameters.
chongz 2016/09/10 00:03:04 Done.
87 96
88 const int routing_id_; 97 const int routing_id_;
89 ui::Window* root_; 98 ui::Window* root_;
90 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 99 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
91 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 100 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
92 InputHandlerManager* const input_handler_manager_; 101 InputHandlerManager* const input_handler_manager_;
93 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_; 102 std::unique_ptr<ui::WindowSurfaceBinding> window_surface_binding_;
94 103
95 // Stores the current state of the active pointers targeting this object. 104 // Stores the current state of the active pointers targeting this object.
96 ui::MotionEventAura pointer_state_; 105 ui::MotionEventAura pointer_state_;
97 106
98 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); 107 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection);
99 }; 108 };
100 109
101 } // namespace content 110 } // namespace content
102 111
103 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 112 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
OLDNEW
« no previous file with comments | « content/renderer/input/input_handler_wrapper.h ('k') | content/renderer/mus/compositor_mus_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698