OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <string> | 10 #include <string> |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 // Stops all existing hang monitor timeouts and assumes the renderer is | 253 // Stops all existing hang monitor timeouts and assumes the renderer is |
254 // responsive. | 254 // responsive. |
255 void StopHangMonitorTimeout(); | 255 void StopHangMonitorTimeout(); |
256 | 256 |
257 // Forwards the given message to the renderer. These are called by the view | 257 // Forwards the given message to the renderer. These are called by the view |
258 // when it has received a message. | 258 // when it has received a message. |
259 virtual void ForwardMouseEvent(const WebKit::WebMouseEvent& mouse_event); | 259 virtual void ForwardMouseEvent(const WebKit::WebMouseEvent& mouse_event); |
260 // Called when a mouse click activates the renderer. | 260 // Called when a mouse click activates the renderer. |
261 virtual void OnMouseActivate(); | 261 virtual void OnMouseActivate(); |
262 void ForwardWheelEvent(const WebKit::WebMouseWheelEvent& wheel_event); | 262 void ForwardWheelEvent(const WebKit::WebMouseWheelEvent& wheel_event); |
| 263 void ForwardGestureEvent(const WebKit::WebGestureEvent& gesture_event); |
263 virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event); | 264 virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event); |
264 virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event); | 265 virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event); |
265 | 266 |
266 | 267 |
267 // Update the text direction of the focused input element and notify it to a | 268 // Update the text direction of the focused input element and notify it to a |
268 // renderer process. | 269 // renderer process. |
269 // These functions have two usage scenarios: changing the text direction | 270 // These functions have two usage scenarios: changing the text direction |
270 // from a menu (as Safari does), and; changing the text direction when a user | 271 // from a menu (as Safari does), and; changing the text direction when a user |
271 // presses a set of keys (as IE and Firefox do). | 272 // presses a set of keys (as IE and Firefox do). |
272 // 1. Change the text direction from a menu. | 273 // 1. Change the text direction from a menu. |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 ignore_input_events_ = ignore_input_events; | 360 ignore_input_events_ = ignore_input_events; |
360 } | 361 } |
361 bool ignore_input_events() const { | 362 bool ignore_input_events() const { |
362 return ignore_input_events_; | 363 return ignore_input_events_; |
363 } | 364 } |
364 | 365 |
365 // Activate deferred plugin handles. | 366 // Activate deferred plugin handles. |
366 void ActivateDeferredPluginHandles(); | 367 void ActivateDeferredPluginHandles(); |
367 | 368 |
368 const gfx::Point& last_scroll_offset() const { return last_scroll_offset_; } | 369 const gfx::Point& last_scroll_offset() const { return last_scroll_offset_; } |
| 370 const gfx::Size& contents_size() const { return contents_size_; } |
369 | 371 |
370 // Notification that the user has made some kind of input that could | 372 // Notification that the user has made some kind of input that could |
371 // perform an action. See OnUserGesture for more details. | 373 // perform an action. See OnUserGesture for more details. |
372 void StartUserGesture(); | 374 void StartUserGesture(); |
373 | 375 |
374 protected: | 376 protected: |
375 // Internal implementation of the public Forward*Event() methods. | 377 // Internal implementation of the public Forward*Event() methods. |
376 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, | 378 void ForwardInputEvent(const WebKit::WebInputEvent& input_event, |
377 int event_size, bool is_keyboard_shortcut); | 379 int event_size, bool is_keyboard_shortcut); |
378 | 380 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 | 545 |
544 // Set if we are waiting for a repaint ack for the view. | 546 // Set if we are waiting for a repaint ack for the view. |
545 bool repaint_ack_pending_; | 547 bool repaint_ack_pending_; |
546 | 548 |
547 // True when waiting for RESIZE_ACK. | 549 // True when waiting for RESIZE_ACK. |
548 bool resize_ack_pending_; | 550 bool resize_ack_pending_; |
549 | 551 |
550 // The current size of the RenderWidget. | 552 // The current size of the RenderWidget. |
551 gfx::Size current_size_; | 553 gfx::Size current_size_; |
552 | 554 |
| 555 // The size of the underlying contents, including parts that are not visible |
| 556 // due to scrolling. It can be used to calculate the view port bounds using |
| 557 // |last_scroll_offset_|. Note: This size is not always available. In |
| 558 // particular, it is only available for RenderViews after a paint has taken |
| 559 // place. Additionally, it only available on the Mac. |
| 560 gfx::Size contents_size_; |
| 561 |
553 // The current reserved area of the RenderWidget where contents should not be | 562 // The current reserved area of the RenderWidget where contents should not be |
554 // rendered to draw the resize corner, sidebar mini tabs etc. | 563 // rendered to draw the resize corner, sidebar mini tabs etc. |
555 gfx::Rect current_reserved_rect_; | 564 gfx::Rect current_reserved_rect_; |
556 | 565 |
557 // The size we last sent as requested size to the renderer. |current_size_| | 566 // The size we last sent as requested size to the renderer. |current_size_| |
558 // is only updated once the resize message has been ack'd. This on the other | 567 // is only updated once the resize message has been ack'd. This on the other |
559 // hand is updated when the resize message is sent. This is very similar to | 568 // hand is updated when the resize message is sent. This is very similar to |
560 // |resize_ack_pending_|, but the latter is not set if the new size has width | 569 // |resize_ack_pending_|, but the latter is not set if the new size has width |
561 // or height zero, which is why we need this too. | 570 // or height zero, which is why we need this too. |
562 gfx::Size in_flight_size_; | 571 gfx::Size in_flight_size_; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 | 677 |
669 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; | 678 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; |
670 | 679 |
671 // The last scroll offset of the render widget. | 680 // The last scroll offset of the render widget. |
672 gfx::Point last_scroll_offset_; | 681 gfx::Point last_scroll_offset_; |
673 | 682 |
674 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); | 683 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); |
675 }; | 684 }; |
676 | 685 |
677 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ | 686 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ |
OLD | NEW |