OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/observer_list.h" | 17 #include "base/observer_list.h" |
18 #include "base/process/kill.h" | 18 #include "base/process/kill.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/timer/timer.h" | |
21 #include "build/build_config.h" | 20 #include "build/build_config.h" |
22 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" | 21 #include "cc/ipc/mojo_compositor_frame_sink.mojom.h" |
23 #include "cc/output/compositor_frame.h" | 22 #include "cc/output/compositor_frame.h" |
24 #include "cc/surfaces/surface_id.h" | 23 #include "cc/surfaces/surface_id.h" |
25 #include "content/browser/renderer_host/event_with_latency_info.h" | 24 #include "content/browser/renderer_host/event_with_latency_info.h" |
26 #include "content/common/content_export.h" | 25 #include "content/common/content_export.h" |
27 #include "content/common/input/input_event_ack_state.h" | 26 #include "content/common/input/input_event_ack_state.h" |
28 #include "content/public/browser/render_widget_host_view.h" | 27 #include "content/public/browser/render_widget_host_view.h" |
29 #include "content/public/common/screen_info.h" | 28 #include "content/public/common/screen_info.h" |
30 #include "ipc/ipc_listener.h" | 29 #include "ipc/ipc_listener.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 182 |
184 // Called prior to forwarding input event messages to the renderer, giving | 183 // Called prior to forwarding input event messages to the renderer, giving |
185 // the view a chance to perform in-process event filtering or processing. | 184 // the view a chance to perform in-process event filtering or processing. |
186 // Return values of |NOT_CONSUMED| or |UNKNOWN| will result in |input_event| | 185 // Return values of |NOT_CONSUMED| or |UNKNOWN| will result in |input_event| |
187 // being forwarded. | 186 // being forwarded. |
188 virtual InputEventAckState FilterInputEvent( | 187 virtual InputEventAckState FilterInputEvent( |
189 const blink::WebInputEvent& input_event); | 188 const blink::WebInputEvent& input_event); |
190 | 189 |
191 // Called by the host when it requires an input flush; the flush call should | 190 // Called by the host when it requires an input flush; the flush call should |
192 // by synchronized with BeginFrame. | 191 // by synchronized with BeginFrame. |
193 virtual void OnSetNeedsFlushInput(); | 192 virtual void OnSetNeedsFlushInput() = 0; |
194 | 193 |
195 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, | 194 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, |
196 InputEventAckState ack_result); | 195 InputEventAckState ack_result); |
197 | 196 |
198 virtual void GestureEventAck(const blink::WebGestureEvent& event, | 197 virtual void GestureEventAck(const blink::WebGestureEvent& event, |
199 InputEventAckState ack_result); | 198 InputEventAckState ack_result); |
200 | 199 |
201 // Create a platform specific SyntheticGestureTarget implementation that will | 200 // Create a platform specific SyntheticGestureTarget implementation that will |
202 // be used to inject synthetic input events. | 201 // be used to inject synthetic input events. |
203 virtual std::unique_ptr<SyntheticGestureTarget> | 202 virtual std::unique_ptr<SyntheticGestureTarget> |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 // The orientation of the display the renderer is currently on. | 449 // The orientation of the display the renderer is currently on. |
451 display::Display::Rotation current_display_rotation_; | 450 display::Display::Rotation current_display_rotation_; |
452 | 451 |
453 // A reference to current TextInputManager instance this RWHV is registered | 452 // A reference to current TextInputManager instance this RWHV is registered |
454 // with. This is initially nullptr until the first time the view calls | 453 // with. This is initially nullptr until the first time the view calls |
455 // GetTextInputManager(). It also becomes nullptr when TextInputManager is | 454 // GetTextInputManager(). It also becomes nullptr when TextInputManager is |
456 // destroyed before the RWHV is destroyed. | 455 // destroyed before the RWHV is destroyed. |
457 TextInputManager* text_input_manager_; | 456 TextInputManager* text_input_manager_; |
458 | 457 |
459 private: | 458 private: |
460 void FlushInput(); | |
461 | |
462 gfx::Rect current_display_area_; | 459 gfx::Rect current_display_area_; |
463 | 460 |
464 uint32_t renderer_frame_number_; | 461 uint32_t renderer_frame_number_; |
465 | 462 |
466 base::OneShotTimer flush_input_timer_; | |
467 | |
468 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; | 463 base::ObserverList<RenderWidgetHostViewBaseObserver> observers_; |
469 | 464 |
470 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; | 465 base::WeakPtrFactory<RenderWidgetHostViewBase> weak_factory_; |
471 | 466 |
472 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); | 467 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewBase); |
473 }; | 468 }; |
474 | 469 |
475 } // namespace content | 470 } // namespace content |
476 | 471 |
477 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ | 472 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_ |
OLD | NEW |