| 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 return input_method_active_; | 349 return input_method_active_; |
| 350 } | 350 } |
| 351 | 351 |
| 352 // Whether forwarded WebInputEvents should be ignored. True if either | 352 // Whether forwarded WebInputEvents should be ignored. True if either |
| 353 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. | 353 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. |
| 354 bool IgnoreInputEvents() const; | 354 bool IgnoreInputEvents() const; |
| 355 | 355 |
| 356 // Event queries delegated to the |input_router_|. | 356 // Event queries delegated to the |input_router_|. |
| 357 bool ShouldForwardTouchEvent() const; | 357 bool ShouldForwardTouchEvent() const; |
| 358 | 358 |
| 359 bool has_touch_handler() const { return has_touch_handler_; } | |
| 360 | |
| 361 // Notification that the user has made some kind of input that could | 359 // Notification that the user has made some kind of input that could |
| 362 // perform an action. See OnUserGesture for more details. | 360 // perform an action. See OnUserGesture for more details. |
| 363 void StartUserGesture(); | 361 void StartUserGesture(); |
| 364 | 362 |
| 365 // Set the RenderView background transparency. | 363 // Set the RenderView background transparency. |
| 366 void SetBackgroundOpaque(bool opaque); | 364 void SetBackgroundOpaque(bool opaque); |
| 367 | 365 |
| 368 // Notifies the renderer that the next key event is bound to one or more | 366 // Notifies the renderer that the next key event is bound to one or more |
| 369 // pre-defined edit commands | 367 // pre-defined edit commands |
| 370 void SetEditCommandsForNextKeyEvent( | 368 void SetEditCommandsForNextKeyEvent( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 | 418 |
| 421 void DetachDelegate(); | 419 void DetachDelegate(); |
| 422 | 420 |
| 423 // Update the renderer's cache of the screen rect of the view and window. | 421 // Update the renderer's cache of the screen rect of the view and window. |
| 424 void SendScreenRects(); | 422 void SendScreenRects(); |
| 425 | 423 |
| 426 // Suppreses future char events until a keydown. See | 424 // Suppreses future char events until a keydown. See |
| 427 // suppress_next_char_events_. | 425 // suppress_next_char_events_. |
| 428 void SuppressNextCharEvents(); | 426 void SuppressNextCharEvents(); |
| 429 | 427 |
| 430 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput. | 428 // Clear any pending input events, preparing for a new input event stream. |
| 429 // This method should be called any time an action (either in the browser |
| 430 // or the renderer) renders potentially buffered events as invalid for the |
| 431 // current target, e.g., main frame navigation. |
| 432 void ResetPendingInput(); |
| 433 |
| 434 // Called by the view in response to flush requests. |
| 431 void FlushInput(); | 435 void FlushInput(); |
| 432 | 436 |
| 433 // InputRouterClient | 437 // Request an input flush from the view. |
| 434 void SetNeedsFlush() override; | 438 void SetNeedsFlushInput(); |
| 435 | 439 |
| 436 // Indicates whether the renderer drives the RenderWidgetHosts's size or the | 440 // Indicates whether the renderer drives the RenderWidgetHosts's size or the |
| 437 // other way around. | 441 // other way around. |
| 438 bool should_auto_resize() { return should_auto_resize_; } | 442 bool should_auto_resize() { return should_auto_resize_; } |
| 439 | 443 |
| 440 void FrameSwapped(const ui::LatencyInfo& latency_info); | 444 void FrameSwapped(const ui::LatencyInfo& latency_info); |
| 441 void DidReceiveRendererFrame(); | 445 void DidReceiveRendererFrame(); |
| 442 | 446 |
| 443 // Returns the ID that uniquely describes this component to the latency | 447 // Returns the ID that uniquely describes this component to the latency |
| 444 // subsystem. | 448 // subsystem. |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 void Destroy(); | 582 void Destroy(); |
| 579 | 583 |
| 580 // Called by |hang_timeout_monitor_| on delayed response from the renderer. | 584 // Called by |hang_timeout_monitor_| on delayed response from the renderer. |
| 581 void RendererIsUnresponsive(); | 585 void RendererIsUnresponsive(); |
| 582 | 586 |
| 583 // Called if we know the renderer is responsive. When we currently think the | 587 // Called if we know the renderer is responsive. When we currently think the |
| 584 // renderer is unresponsive, this will clear that state and call | 588 // renderer is unresponsive, this will clear that state and call |
| 585 // NotifyRendererResponsive. | 589 // NotifyRendererResponsive. |
| 586 void RendererIsResponsive(); | 590 void RendererIsResponsive(); |
| 587 | 591 |
| 592 // Recreate the input router, e.g., when the render process has crashed. |
| 593 void ResetInputRouter(); |
| 594 |
| 588 // IPC message handlers | 595 // IPC message handlers |
| 589 void OnRenderViewReady(); | 596 void OnRenderViewReady(); |
| 590 void OnRenderProcessGone(int status, int error_code); | 597 void OnRenderProcessGone(int status, int error_code); |
| 591 void OnClose(); | 598 void OnClose(); |
| 592 void OnUpdateScreenRectsAck(); | 599 void OnUpdateScreenRectsAck(); |
| 593 void OnRequestMove(const gfx::Rect& pos); | 600 void OnRequestMove(const gfx::Rect& pos); |
| 594 void OnSetTooltipText(const base::string16& tooltip_text, | 601 void OnSetTooltipText(const base::string16& tooltip_text, |
| 595 blink::WebTextDirection text_direction_hint); | 602 blink::WebTextDirection text_direction_hint); |
| 596 bool OnSwapCompositorFrame(const IPC::Message& message); | 603 bool OnSwapCompositorFrame(const IPC::Message& message); |
| 597 void OnFlingingStopped(); | 604 void OnFlingingStopped(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 // Give key press listeners a chance to handle this key press. This allow | 647 // Give key press listeners a chance to handle this key press. This allow |
| 641 // widgets that don't have focus to still handle key presses. | 648 // widgets that don't have focus to still handle key presses. |
| 642 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); | 649 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); |
| 643 | 650 |
| 644 // InputRouterClient | 651 // InputRouterClient |
| 645 InputEventAckState FilterInputEvent( | 652 InputEventAckState FilterInputEvent( |
| 646 const blink::WebInputEvent& event, | 653 const blink::WebInputEvent& event, |
| 647 const ui::LatencyInfo& latency_info) override; | 654 const ui::LatencyInfo& latency_info) override; |
| 648 void IncrementInFlightEventCount() override; | 655 void IncrementInFlightEventCount() override; |
| 649 void DecrementInFlightEventCount() override; | 656 void DecrementInFlightEventCount() override; |
| 650 void OnHasTouchEventHandlers(bool has_handlers) override; | |
| 651 void DidFlush() override; | 657 void DidFlush() override; |
| 652 void DidOverscroll(const DidOverscrollParams& params) override; | 658 void DidOverscroll(const DidOverscrollParams& params) override; |
| 653 | 659 |
| 654 // InputAckHandler | 660 // InputAckHandler |
| 655 void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, | 661 void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, |
| 656 InputEventAckState ack_result) override; | 662 InputEventAckState ack_result) override; |
| 657 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 663 void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
| 658 InputEventAckState ack_result) override; | 664 InputEventAckState ack_result) override; |
| 659 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 665 void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
| 660 InputEventAckState ack_result) override; | 666 InputEventAckState ack_result) override; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 // For example, pressing alt-2 may let the browser switch to the second tab, | 817 // For example, pressing alt-2 may let the browser switch to the second tab, |
| 812 // but the Char event generated by alt-2 may also activate a HTML element | 818 // but the Char event generated by alt-2 may also activate a HTML element |
| 813 // if its accesskey happens to be "2", then the user may get confused when | 819 // if its accesskey happens to be "2", then the user may get confused when |
| 814 // switching back to the original tab, because the content may already be | 820 // switching back to the original tab, because the content may already be |
| 815 // changed. | 821 // changed. |
| 816 bool suppress_next_char_events_; | 822 bool suppress_next_char_events_; |
| 817 | 823 |
| 818 bool pending_mouse_lock_request_; | 824 bool pending_mouse_lock_request_; |
| 819 bool allow_privileged_mouse_lock_; | 825 bool allow_privileged_mouse_lock_; |
| 820 | 826 |
| 821 // Keeps track of whether the webpage has any touch event handler. If it does, | |
| 822 // then touch events are sent to the renderer. Otherwise, the touch events are | |
| 823 // not sent to the renderer. | |
| 824 bool has_touch_handler_; | |
| 825 | |
| 826 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; | 827 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; |
| 827 | 828 |
| 828 scoped_ptr<TouchEmulator> touch_emulator_; | 829 scoped_ptr<TouchEmulator> touch_emulator_; |
| 829 | 830 |
| 830 // Receives and handles all input events. | 831 // Receives and handles all input events. |
| 831 scoped_ptr<InputRouter> input_router_; | 832 scoped_ptr<InputRouter> input_router_; |
| 832 | 833 |
| 833 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 834 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
| 834 | 835 |
| 835 #if defined(OS_WIN) | 836 #if defined(OS_WIN) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 846 cc::RollingTimeDeltaHistory browser_composite_latency_history_; | 847 cc::RollingTimeDeltaHistory browser_composite_latency_history_; |
| 847 | 848 |
| 848 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 849 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
| 849 | 850 |
| 850 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 851 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
| 851 }; | 852 }; |
| 852 | 853 |
| 853 } // namespace content | 854 } // namespace content |
| 854 | 855 |
| 855 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 856 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
| OLD | NEW |