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 <deque> | 8 #include <deque> |
9 #include <list> | 9 #include <list> |
10 #include <map> | 10 #include <map> |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 #if defined(OS_ANDROID) | 75 #if defined(OS_ANDROID) |
76 namespace blink { | 76 namespace blink { |
77 class WebLayer; | 77 class WebLayer; |
78 } | 78 } |
79 #endif | 79 #endif |
80 | 80 |
81 namespace content { | 81 namespace content { |
82 class InputRouter; | 82 class InputRouter; |
83 class MockRenderWidgetHost; | 83 class MockRenderWidgetHost; |
84 class OverscrollController; | |
85 class RenderWidgetHostDelegate; | 84 class RenderWidgetHostDelegate; |
86 class RenderWidgetHostViewBase; | 85 class RenderWidgetHostViewBase; |
87 class SyntheticGestureController; | 86 class SyntheticGestureController; |
88 class TimeoutMonitor; | 87 class TimeoutMonitor; |
89 class TouchEmulator; | 88 class TouchEmulator; |
90 class WebCursor; | 89 class WebCursor; |
91 struct EditCommand; | 90 struct EditCommand; |
92 | 91 |
93 // This implements the RenderWidgetHost interface that is exposed to | 92 // This implements the RenderWidgetHost interface that is exposed to |
94 // embedders of content, and adds things only visible to content. | 93 // embedders of content, and adds things only visible to content. |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 // We need to reset these flags when we want to repaint the contents of | 463 // We need to reset these flags when we want to repaint the contents of |
465 // browser plugin in this RWH. Resetting these flags will ensure we ignore | 464 // browser plugin in this RWH. Resetting these flags will ensure we ignore |
466 // any previous pending acks that are not relevant upon repaint. | 465 // any previous pending acks that are not relevant upon repaint. |
467 void ResetSizeAndRepaintPendingFlags(); | 466 void ResetSizeAndRepaintPendingFlags(); |
468 | 467 |
469 void DetachDelegate(); | 468 void DetachDelegate(); |
470 | 469 |
471 // Update the renderer's cache of the screen rect of the view and window. | 470 // Update the renderer's cache of the screen rect of the view and window. |
472 void SendScreenRects(); | 471 void SendScreenRects(); |
473 | 472 |
474 OverscrollController* overscroll_controller() const { | |
475 return overscroll_controller_.get(); | |
476 } | |
477 | |
478 // Sets whether the overscroll controller should be enabled for this page. | |
479 void SetOverscrollControllerEnabled(bool enabled); | |
480 | |
481 // Suppreses future char events until a keydown. See | 473 // Suppreses future char events until a keydown. See |
482 // suppress_next_char_events_. | 474 // suppress_next_char_events_. |
483 void SuppressNextCharEvents(); | 475 void SuppressNextCharEvents(); |
484 | 476 |
485 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput. | 477 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput. |
486 void FlushInput(); | 478 void FlushInput(); |
487 | 479 |
488 // InputRouterClient | 480 // InputRouterClient |
489 virtual void SetNeedsFlush() OVERRIDE; | 481 virtual void SetNeedsFlush() OVERRIDE; |
490 | 482 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 570 |
579 // Indicates if the render widget host should track the render widget's size | 571 // Indicates if the render widget host should track the render widget's size |
580 // as opposed to visa versa. | 572 // as opposed to visa versa. |
581 void SetShouldAutoResize(bool enable); | 573 void SetShouldAutoResize(bool enable); |
582 | 574 |
583 // Expose increment/decrement of the in-flight event count, so | 575 // Expose increment/decrement of the in-flight event count, so |
584 // RenderViewHostImpl can account for in-flight beforeunload/unload events. | 576 // RenderViewHostImpl can account for in-flight beforeunload/unload events. |
585 int increment_in_flight_event_count() { return ++in_flight_event_count_; } | 577 int increment_in_flight_event_count() { return ++in_flight_event_count_; } |
586 int decrement_in_flight_event_count() { return --in_flight_event_count_; } | 578 int decrement_in_flight_event_count() { return --in_flight_event_count_; } |
587 | 579 |
588 // Returns whether an overscroll gesture is in progress. | |
589 bool IsInOverscrollGesture() const; | |
590 | |
591 // The View associated with the RenderViewHost. The lifetime of this object | 580 // The View associated with the RenderViewHost. The lifetime of this object |
592 // is associated with the lifetime of the Render process. If the Renderer | 581 // is associated with the lifetime of the Render process. If the Renderer |
593 // crashes, its View is destroyed and this pointer becomes NULL, even though | 582 // crashes, its View is destroyed and this pointer becomes NULL, even though |
594 // render_view_host_ lives on to load another URL (creating a new View while | 583 // render_view_host_ lives on to load another URL (creating a new View while |
595 // doing so). | 584 // doing so). |
596 RenderWidgetHostViewBase* view_; | 585 RenderWidgetHostViewBase* view_; |
597 | 586 |
598 // true if a renderer has once been valid. We use this flag to display a sad | 587 // true if a renderer has once been valid. We use this flag to display a sad |
599 // tab only when we lose our renderer and not if a paint occurs during | 588 // tab only when we lose our renderer and not if a paint occurs during |
600 // initialization. | 589 // initialization. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 // widgets that don't have focus to still handle key presses. | 665 // widgets that don't have focus to still handle key presses. |
677 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); | 666 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); |
678 | 667 |
679 // InputRouterClient | 668 // InputRouterClient |
680 virtual InputEventAckState FilterInputEvent( | 669 virtual InputEventAckState FilterInputEvent( |
681 const blink::WebInputEvent& event, | 670 const blink::WebInputEvent& event, |
682 const ui::LatencyInfo& latency_info) OVERRIDE; | 671 const ui::LatencyInfo& latency_info) OVERRIDE; |
683 virtual void IncrementInFlightEventCount() OVERRIDE; | 672 virtual void IncrementInFlightEventCount() OVERRIDE; |
684 virtual void DecrementInFlightEventCount() OVERRIDE; | 673 virtual void DecrementInFlightEventCount() OVERRIDE; |
685 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE; | 674 virtual void OnHasTouchEventHandlers(bool has_handlers) OVERRIDE; |
686 virtual OverscrollController* GetOverscrollController() const OVERRIDE; | |
687 virtual void DidFlush() OVERRIDE; | 675 virtual void DidFlush() OVERRIDE; |
688 virtual void DidOverscroll(const DidOverscrollParams& params) OVERRIDE; | 676 virtual void DidOverscroll(const DidOverscrollParams& params) OVERRIDE; |
689 | 677 |
690 // InputAckHandler | 678 // InputAckHandler |
691 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, | 679 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, |
692 InputEventAckState ack_result) OVERRIDE; | 680 InputEventAckState ack_result) OVERRIDE; |
693 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 681 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
694 InputEventAckState ack_result) OVERRIDE; | 682 InputEventAckState ack_result) OVERRIDE; |
695 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 683 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
696 InputEventAckState ack_result) OVERRIDE; | 684 InputEventAckState ack_result) OVERRIDE; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 | 846 |
859 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 847 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
860 | 848 |
861 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; | 849 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; |
862 | 850 |
863 scoped_ptr<TouchEmulator> touch_emulator_; | 851 scoped_ptr<TouchEmulator> touch_emulator_; |
864 | 852 |
865 // Receives and handles all input events. | 853 // Receives and handles all input events. |
866 scoped_ptr<InputRouter> input_router_; | 854 scoped_ptr<InputRouter> input_router_; |
867 | 855 |
868 scoped_ptr<OverscrollController> overscroll_controller_; | |
869 | |
870 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 856 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
871 | 857 |
872 #if defined(OS_WIN) | 858 #if defined(OS_WIN) |
873 std::list<HWND> dummy_windows_for_activation_; | 859 std::list<HWND> dummy_windows_for_activation_; |
874 #endif | 860 #endif |
875 | 861 |
876 int64 last_input_number_; | 862 int64 last_input_number_; |
877 | 863 |
878 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 864 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
879 }; | 865 }; |
880 | 866 |
881 } // namespace content | 867 } // namespace content |
882 | 868 |
883 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 869 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |