| 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 | 676 |
| 689 // InputAckHandler | 677 // InputAckHandler |
| 690 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, | 678 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, |
| 691 InputEventAckState ack_result) OVERRIDE; | 679 InputEventAckState ack_result) OVERRIDE; |
| 692 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 680 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
| 693 InputEventAckState ack_result) OVERRIDE; | 681 InputEventAckState ack_result) OVERRIDE; |
| 694 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 682 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 695 InputEventAckState ack_result) OVERRIDE; | 683 InputEventAckState ack_result) OVERRIDE; |
| 696 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, | 684 virtual void OnGestureEventAck(const GestureEventWithLatencyInfo& event, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 | 845 |
| 858 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 846 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 859 | 847 |
| 860 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; | 848 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; |
| 861 | 849 |
| 862 scoped_ptr<TouchEmulator> touch_emulator_; | 850 scoped_ptr<TouchEmulator> touch_emulator_; |
| 863 | 851 |
| 864 // Receives and handles all input events. | 852 // Receives and handles all input events. |
| 865 scoped_ptr<InputRouter> input_router_; | 853 scoped_ptr<InputRouter> input_router_; |
| 866 | 854 |
| 867 scoped_ptr<OverscrollController> overscroll_controller_; | |
| 868 | |
| 869 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 855 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
| 870 | 856 |
| 871 #if defined(OS_WIN) | 857 #if defined(OS_WIN) |
| 872 std::list<HWND> dummy_windows_for_activation_; | 858 std::list<HWND> dummy_windows_for_activation_; |
| 873 #endif | 859 #endif |
| 874 | 860 |
| 875 int64 last_input_number_; | 861 int64 last_input_number_; |
| 876 | 862 |
| 877 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 863 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 878 }; | 864 }; |
| 879 | 865 |
| 880 } // namespace content | 866 } // namespace content |
| 881 | 867 |
| 882 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 868 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |