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

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

Issue 2576013002: Introducing WebCoalescedInputEvent and inclusion in content/common (Closed)
Patch Set: Fix a few DCHECK hits Created 3 years, 11 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 <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
15 #include "content/common/input/input_event_ack_state.h" 15 #include "content/common/input/input_event_ack_state.h"
16 #include "services/ui/public/cpp/input_event_handler.h" 16 #include "services/ui/public/cpp/input_event_handler.h"
17 #include "services/ui/public/cpp/window.h" 17 #include "services/ui/public/cpp/window.h"
18 #include "services/ui/public/cpp/window_tree_client.h" 18 #include "services/ui/public/cpp/window_tree_client.h"
19 #include "services/ui/public/cpp/window_tree_client_delegate.h" 19 #include "services/ui/public/cpp/window_tree_client_delegate.h"
20 #include "third_party/WebKit/public/platform/WebInputEvent.h" 20 #include "third_party/WebKit/public/platform/WebCoalescedInputEvent.h"
21 #include "ui/events/blink/scoped_web_input_event.h"
22 #include "ui/events/gestures/motion_event_aura.h" 21 #include "ui/events/gestures/motion_event_aura.h"
23 22
24 namespace ui { 23 namespace ui {
25 struct DidOverscrollParams; 24 struct DidOverscrollParams;
26 } 25 }
27 26
28 namespace content { 27 namespace content {
29 28
30 class InputHandlerManager; 29 class InputHandlerManager;
31 30
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 void AttachCompositorFrameSinkOnCompositorThread( 62 void AttachCompositorFrameSinkOnCompositorThread(
64 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> 63 std::unique_ptr<ui::WindowCompositorFrameSinkBinding>
65 compositor_frame_sink_binding); 64 compositor_frame_sink_binding);
66 65
67 void CreateWindowTreeClientOnCompositorThread( 66 void CreateWindowTreeClientOnCompositorThread(
68 ui::mojom::WindowTreeClientRequest request); 67 ui::mojom::WindowTreeClientRequest request);
69 68
70 void OnConnectionLostOnMainThread(); 69 void OnConnectionLostOnMainThread();
71 70
72 void OnWindowInputEventOnMainThread( 71 void OnWindowInputEventOnMainThread(
73 ui::ScopedWebInputEvent web_event, 72 blink::WebScopedInputEvent web_event,
74 const base::Callback<void(ui::mojom::EventResult)>& ack); 73 const base::Callback<void(ui::mojom::EventResult)>& ack);
75 74
76 void OnWindowInputEventAckOnMainThread( 75 void OnWindowInputEventAckOnMainThread(
77 const base::Callback<void(ui::mojom::EventResult)>& ack, 76 const base::Callback<void(ui::mojom::EventResult)>& ack,
78 ui::mojom::EventResult result); 77 ui::mojom::EventResult result);
79 78
80 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event); 79 std::unique_ptr<blink::WebInputEvent> Convert(const ui::Event& event);
81 80
82 void DeleteWindowTreeClient(); 81 void DeleteWindowTreeClient();
83 82
84 // WindowTreeClientDelegate implementation: 83 // WindowTreeClientDelegate implementation:
85 void OnEmbed(ui::Window* root) override; 84 void OnEmbed(ui::Window* root) override;
86 void OnEmbedRootDestroyed(ui::Window* root) override; 85 void OnEmbedRootDestroyed(ui::Window* root) override;
87 void OnLostConnection(ui::WindowTreeClient* client) override; 86 void OnLostConnection(ui::WindowTreeClient* client) override;
88 void OnPointerEventObserved(const ui::PointerEvent& event, 87 void OnPointerEventObserved(const ui::PointerEvent& event,
89 ui::Window* target) override; 88 ui::Window* target) override;
90 89
91 // InputEventHandler implementation: 90 // InputEventHandler implementation:
92 void OnWindowInputEvent( 91 void OnWindowInputEvent(
93 ui::Window* window, 92 ui::Window* window,
94 const ui::Event& event, 93 const ui::Event& event,
95 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>* 94 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>*
96 ack_callback) override; 95 ack_callback) override;
97 void DidHandleWindowInputEventAndOverscroll( 96 void DidHandleWindowInputEventAndOverscroll(
98 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>> 97 std::unique_ptr<base::Callback<void(ui::mojom::EventResult)>>
99 ack_callback, 98 ack_callback,
100 InputEventAckState ack_state, 99 InputEventAckState ack_state,
101 ui::ScopedWebInputEvent web_event, 100 blink::WebScopedInputEvent web_event,
102 const ui::LatencyInfo& latency_info, 101 const ui::LatencyInfo& latency_info,
103 std::unique_ptr<ui::DidOverscrollParams> overscroll_params); 102 std::unique_ptr<ui::DidOverscrollParams> overscroll_params);
104 103
105 const int routing_id_; 104 const int routing_id_;
106 // Use this lock when accessing |window_tree_client_|. Lock exists solely for 105 // Use this lock when accessing |window_tree_client_|. Lock exists solely for
107 // DCHECK in destructor. 106 // DCHECK in destructor.
108 base::Lock window_tree_client_lock_; 107 base::Lock window_tree_client_lock_;
109 std::unique_ptr<ui::WindowTreeClient> window_tree_client_; 108 std::unique_ptr<ui::WindowTreeClient> window_tree_client_;
110 ui::Window* root_; 109 ui::Window* root_;
111 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 110 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
112 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_; 111 scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
113 InputHandlerManager* const input_handler_manager_; 112 InputHandlerManager* const input_handler_manager_;
114 std::unique_ptr<ui::WindowCompositorFrameSinkBinding> 113 std::unique_ptr<ui::WindowCompositorFrameSinkBinding>
115 window_compositor_frame_sink_binding_; 114 window_compositor_frame_sink_binding_;
116 115
117 // Stores the current state of the active pointers targeting this object. 116 // Stores the current state of the active pointers targeting this object.
118 ui::MotionEventAura pointer_state_; 117 ui::MotionEventAura pointer_state_;
119 118
120 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection); 119 DISALLOW_COPY_AND_ASSIGN(CompositorMusConnection);
121 }; 120 };
122 121
123 } // namespace content 122 } // namespace content
124 123
125 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_ 124 #endif // CONTENT_RENDERER_MUS_COMPOSITOR_MUS_CONNECTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698