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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 void ResizeRectChanged(const gfx::Rect& new_rect) override; | 162 void ResizeRectChanged(const gfx::Rect& new_rect) override; |
163 void RestartHangMonitorTimeout() override; | 163 void RestartHangMonitorTimeout() override; |
164 void DisableHangMonitorForTesting() override; | 164 void DisableHangMonitorForTesting() override; |
165 void SetIgnoreInputEvents(bool ignore_input_events) override; | 165 void SetIgnoreInputEvents(bool ignore_input_events) override; |
166 void WasResized() override; | 166 void WasResized() override; |
167 void AddKeyPressEventCallback(const KeyPressEventCallback& callback) override; | 167 void AddKeyPressEventCallback(const KeyPressEventCallback& callback) override; |
168 void RemoveKeyPressEventCallback( | 168 void RemoveKeyPressEventCallback( |
169 const KeyPressEventCallback& callback) override; | 169 const KeyPressEventCallback& callback) override; |
170 void AddMouseEventCallback(const MouseEventCallback& callback) override; | 170 void AddMouseEventCallback(const MouseEventCallback& callback) override; |
171 void RemoveMouseEventCallback(const MouseEventCallback& callback) override; | 171 void RemoveMouseEventCallback(const MouseEventCallback& callback) override; |
| 172 void AddInputEventObserver( |
| 173 RenderWidgetHost::InputEventObserver* observer) override; |
| 174 void RemoveInputEventObserver( |
| 175 RenderWidgetHost::InputEventObserver* observer) override; |
172 void GetWebScreenInfo(blink::WebScreenInfo* result) override; | 176 void GetWebScreenInfo(blink::WebScreenInfo* result) override; |
173 bool GetScreenColorProfile(std::vector<char>* color_profile) override; | 177 bool GetScreenColorProfile(std::vector<char>* color_profile) override; |
174 void HandleCompositorProto(const std::vector<uint8_t>& proto) override; | 178 void HandleCompositorProto(const std::vector<uint8_t>& proto) override; |
175 | 179 |
176 // Notification that the screen info has changed. | 180 // Notification that the screen info has changed. |
177 void NotifyScreenInfoChanged(); | 181 void NotifyScreenInfoChanged(); |
178 | 182 |
179 // Forces redraw in the renderer and when the update reaches the browser | 183 // Forces redraw in the renderer and when the update reaches the browser |
180 // grabs snapshot from the compositor. Returns PNG-encoded snapshot. | 184 // grabs snapshot from the compositor. Returns PNG-encoded snapshot. |
181 using GetSnapshotFromBrowserCallback = | 185 using GetSnapshotFromBrowserCallback = |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 InputEventAckState FilterInputEvent( | 602 InputEventAckState FilterInputEvent( |
599 const blink::WebInputEvent& event, | 603 const blink::WebInputEvent& event, |
600 const ui::LatencyInfo& latency_info) override; | 604 const ui::LatencyInfo& latency_info) override; |
601 void IncrementInFlightEventCount() override; | 605 void IncrementInFlightEventCount() override; |
602 void DecrementInFlightEventCount() override; | 606 void DecrementInFlightEventCount() override; |
603 void OnHasTouchEventHandlers(bool has_handlers) override; | 607 void OnHasTouchEventHandlers(bool has_handlers) override; |
604 void DidFlush() override; | 608 void DidFlush() override; |
605 void DidOverscroll(const DidOverscrollParams& params) override; | 609 void DidOverscroll(const DidOverscrollParams& params) override; |
606 void DidStopFlinging() override; | 610 void DidStopFlinging() override; |
607 | 611 |
| 612 // Dispatch input events with latency information |
| 613 void DispatchInputEventWithLatencyInfo(const blink::WebInputEvent& event, |
| 614 ui::LatencyInfo* latency); |
| 615 |
608 // InputAckHandler | 616 // InputAckHandler |
609 void OnKeyboardEventAck(const NativeWebKeyboardEventWithLatencyInfo& event, | 617 void OnKeyboardEventAck(const NativeWebKeyboardEventWithLatencyInfo& event, |
610 InputEventAckState ack_result) override; | 618 InputEventAckState ack_result) override; |
611 void OnMouseEventAck(const MouseEventWithLatencyInfo& event, | 619 void OnMouseEventAck(const MouseEventWithLatencyInfo& event, |
612 InputEventAckState ack_result) override; | 620 InputEventAckState ack_result) override; |
613 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 621 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
614 InputEventAckState ack_result) override; | 622 InputEventAckState ack_result) override; |
615 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 623 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
616 InputEventAckState ack_result) override; | 624 InputEventAckState ack_result) override; |
617 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 625 void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 bool waiting_for_screen_rects_ack_; | 703 bool waiting_for_screen_rects_ack_; |
696 gfx::Rect last_view_screen_rect_; | 704 gfx::Rect last_view_screen_rect_; |
697 gfx::Rect last_window_screen_rect_; | 705 gfx::Rect last_window_screen_rect_; |
698 | 706 |
699 // Keyboard event listeners. | 707 // Keyboard event listeners. |
700 std::vector<KeyPressEventCallback> key_press_event_callbacks_; | 708 std::vector<KeyPressEventCallback> key_press_event_callbacks_; |
701 | 709 |
702 // Mouse event callbacks. | 710 // Mouse event callbacks. |
703 std::vector<MouseEventCallback> mouse_event_callbacks_; | 711 std::vector<MouseEventCallback> mouse_event_callbacks_; |
704 | 712 |
| 713 // Input event callbacks. |
| 714 base::ObserverList<RenderWidgetHost::InputEventObserver> |
| 715 input_event_observers_; |
| 716 |
705 // If true, then we should repaint when restoring even if we have a | 717 // If true, then we should repaint when restoring even if we have a |
706 // backingstore. This flag is set to true if we receive a paint message | 718 // backingstore. This flag is set to true if we receive a paint message |
707 // while is_hidden_ to true. Even though we tell the render widget to hide | 719 // while is_hidden_ to true. Even though we tell the render widget to hide |
708 // itself, a paint message could already be in flight at that point. | 720 // itself, a paint message could already be in flight at that point. |
709 bool needs_repainting_on_restore_; | 721 bool needs_repainting_on_restore_; |
710 | 722 |
711 // This is true if the renderer is currently unresponsive. | 723 // This is true if the renderer is currently unresponsive. |
712 bool is_unresponsive_; | 724 bool is_unresponsive_; |
713 | 725 |
714 // This value denotes the number of input events yet to be acknowledged | 726 // This value denotes the number of input events yet to be acknowledged |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 base::TimeDelta new_content_rendering_delay_; | 822 base::TimeDelta new_content_rendering_delay_; |
811 | 823 |
812 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 824 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
813 | 825 |
814 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 826 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
815 }; | 827 }; |
816 | 828 |
817 } // namespace content | 829 } // namespace content |
818 | 830 |
819 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 831 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |