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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 return input_method_active_; | 355 return input_method_active_; |
356 } | 356 } |
357 | 357 |
358 // Whether forwarded WebInputEvents should be ignored. True if either | 358 // Whether forwarded WebInputEvents should be ignored. True if either |
359 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. | 359 // |ignore_input_events_| or |process_->IgnoreInputEvents()| is true. |
360 bool IgnoreInputEvents() const; | 360 bool IgnoreInputEvents() const; |
361 | 361 |
362 // Event queries delegated to the |input_router_|. | 362 // Event queries delegated to the |input_router_|. |
363 bool ShouldForwardTouchEvent() const; | 363 bool ShouldForwardTouchEvent() const; |
364 | 364 |
365 bool has_touch_handler() const { return has_touch_handler_; } | |
366 | |
367 // Notification that the user has made some kind of input that could | 365 // Notification that the user has made some kind of input that could |
368 // perform an action. See OnUserGesture for more details. | 366 // perform an action. See OnUserGesture for more details. |
369 void StartUserGesture(); | 367 void StartUserGesture(); |
370 | 368 |
371 // Set the RenderView background transparency. | 369 // Set the RenderView background transparency. |
372 void SetBackgroundOpaque(bool opaque); | 370 void SetBackgroundOpaque(bool opaque); |
373 | 371 |
374 // Notifies the renderer that the next key event is bound to one or more | 372 // Notifies the renderer that the next key event is bound to one or more |
375 // pre-defined edit commands | 373 // pre-defined edit commands |
376 void SetEditCommandsForNextKeyEvent( | 374 void SetEditCommandsForNextKeyEvent( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 | 424 |
427 void DetachDelegate(); | 425 void DetachDelegate(); |
428 | 426 |
429 // Update the renderer's cache of the screen rect of the view and window. | 427 // Update the renderer's cache of the screen rect of the view and window. |
430 void SendScreenRects(); | 428 void SendScreenRects(); |
431 | 429 |
432 // Suppreses future char events until a keydown. See | 430 // Suppreses future char events until a keydown. See |
433 // suppress_next_char_events_. | 431 // suppress_next_char_events_. |
434 void SuppressNextCharEvents(); | 432 void SuppressNextCharEvents(); |
435 | 433 |
436 // Called by RenderWidgetHostView in response to OnSetNeedsFlushInput. | 434 // Called by the view in response to flush requests. |
437 void FlushInput(); | 435 void FlushInput(); |
438 | 436 |
439 // InputRouterClient | 437 // Request a flush from the view. |
440 virtual void SetNeedsFlush() override; | 438 void SetNeedsFlush(); |
441 | 439 |
442 // Indicates whether the renderer drives the RenderWidgetHosts's size or the | 440 // Indicates whether the renderer drives the RenderWidgetHosts's size or the |
443 // other way around. | 441 // other way around. |
444 bool should_auto_resize() { return should_auto_resize_; } | 442 bool should_auto_resize() { return should_auto_resize_; } |
445 | 443 |
446 void ComputeTouchLatency(const ui::LatencyInfo& latency_info); | 444 void ComputeTouchLatency(const ui::LatencyInfo& latency_info); |
447 void FrameSwapped(const ui::LatencyInfo& latency_info); | 445 void FrameSwapped(const ui::LatencyInfo& latency_info); |
448 void DidReceiveRendererFrame(); | 446 void DidReceiveRendererFrame(); |
449 | 447 |
450 // Returns the ID that uniquely describes this component to the latency | 448 // Returns the ID that uniquely describes this component to the latency |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 // Give key press listeners a chance to handle this key press. This allow | 639 // Give key press listeners a chance to handle this key press. This allow |
642 // widgets that don't have focus to still handle key presses. | 640 // widgets that don't have focus to still handle key presses. |
643 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); | 641 bool KeyPressListenersHandleEvent(const NativeWebKeyboardEvent& event); |
644 | 642 |
645 // InputRouterClient | 643 // InputRouterClient |
646 virtual InputEventAckState FilterInputEvent( | 644 virtual InputEventAckState FilterInputEvent( |
647 const blink::WebInputEvent& event, | 645 const blink::WebInputEvent& event, |
648 const ui::LatencyInfo& latency_info) override; | 646 const ui::LatencyInfo& latency_info) override; |
649 virtual void IncrementInFlightEventCount() override; | 647 virtual void IncrementInFlightEventCount() override; |
650 virtual void DecrementInFlightEventCount() override; | 648 virtual void DecrementInFlightEventCount() override; |
651 virtual void OnHasTouchEventHandlers(bool has_handlers) override; | |
652 virtual void DidFlush() override; | 649 virtual void DidFlush() override; |
653 virtual void DidOverscroll(const DidOverscrollParams& params) override; | 650 virtual void DidOverscroll(const DidOverscrollParams& params) override; |
654 | 651 |
655 // InputAckHandler | 652 // InputAckHandler |
656 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, | 653 virtual void OnKeyboardEventAck(const NativeWebKeyboardEvent& event, |
657 InputEventAckState ack_result) override; | 654 InputEventAckState ack_result) override; |
658 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, | 655 virtual void OnWheelEventAck(const MouseWheelEventWithLatencyInfo& event, |
659 InputEventAckState ack_result) override; | 656 InputEventAckState ack_result) override; |
660 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, | 657 virtual void OnTouchEventAck(const TouchEventWithLatencyInfo& event, |
661 InputEventAckState ack_result) override; | 658 InputEventAckState ack_result) override; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 // For example, pressing alt-2 may let the browser switch to the second tab, | 809 // For example, pressing alt-2 may let the browser switch to the second tab, |
813 // but the Char event generated by alt-2 may also activate a HTML element | 810 // but the Char event generated by alt-2 may also activate a HTML element |
814 // if its accesskey happens to be "2", then the user may get confused when | 811 // if its accesskey happens to be "2", then the user may get confused when |
815 // switching back to the original tab, because the content may already be | 812 // switching back to the original tab, because the content may already be |
816 // changed. | 813 // changed. |
817 bool suppress_next_char_events_; | 814 bool suppress_next_char_events_; |
818 | 815 |
819 bool pending_mouse_lock_request_; | 816 bool pending_mouse_lock_request_; |
820 bool allow_privileged_mouse_lock_; | 817 bool allow_privileged_mouse_lock_; |
821 | 818 |
822 // Keeps track of whether the webpage has any touch event handler. If it does, | |
823 // then touch events are sent to the renderer. Otherwise, the touch events are | |
824 // not sent to the renderer. | |
825 bool has_touch_handler_; | |
826 | |
827 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; | 819 scoped_ptr<SyntheticGestureController> synthetic_gesture_controller_; |
828 | 820 |
829 scoped_ptr<TouchEmulator> touch_emulator_; | 821 scoped_ptr<TouchEmulator> touch_emulator_; |
830 | 822 |
831 // Receives and handles all input events. | 823 // Receives and handles all input events. |
832 scoped_ptr<InputRouter> input_router_; | 824 scoped_ptr<InputRouter> input_router_; |
833 | 825 |
834 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; | 826 scoped_ptr<TimeoutMonitor> hang_monitor_timeout_; |
835 | 827 |
836 #if defined(OS_WIN) | 828 #if defined(OS_WIN) |
(...skipping 10 matching lines...) Expand all Loading... |
847 cc::RollingTimeDeltaHistory browser_composite_latency_history_; | 839 cc::RollingTimeDeltaHistory browser_composite_latency_history_; |
848 | 840 |
849 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; | 841 base::WeakPtrFactory<RenderWidgetHostImpl> weak_factory_; |
850 | 842 |
851 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); | 843 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostImpl); |
852 }; | 844 }; |
853 | 845 |
854 } // namespace content | 846 } // namespace content |
855 | 847 |
856 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ | 848 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_IMPL_H_ |
OLD | NEW |