Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: content/browser/renderer_host/render_widget_host.h

Issue 7044096: Throttle the touch move events sent to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nuke ifdefs Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event); 263 virtual void ForwardKeyboardEvent(const NativeWebKeyboardEvent& key_event);
264 #if defined(TOUCH_UI)
265 virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event); 264 virtual void ForwardTouchEvent(const WebKit::WebTouchEvent& touch_event);
266 #endif
267 265
268 266
269 // Update the text direction of the focused input element and notify it to a 267 // Update the text direction of the focused input element and notify it to a
270 // renderer process. 268 // renderer process.
271 // These functions have two usage scenarios: changing the text direction 269 // These functions have two usage scenarios: changing the text direction
272 // from a menu (as Safari does), and; changing the text direction when a user 270 // from a menu (as Safari does), and; changing the text direction when a user
273 // presses a set of keys (as IE and Firefox do). 271 // presses a set of keys (as IE and Firefox do).
274 // 1. Change the text direction from a menu. 272 // 1. Change the text direction from a menu.
275 // In this scenario, we receive a menu event only once and we should update 273 // In this scenario, we receive a menu event only once and we should update
276 // the text direction immediately when a user chooses a menu item. So, we 274 // the text direction immediately when a user chooses a menu item. So, we
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 581
584 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send. 582 // (Similar to |next_mouse_move_|.) The next mouse wheel events to send.
585 // Unlike mouse moves, mouse wheel events received while one is pending are 583 // Unlike mouse moves, mouse wheel events received while one is pending are
586 // coalesced (by accumulating deltas) if they match the previous event in 584 // coalesced (by accumulating deltas) if they match the previous event in
587 // modifiers. On the Mac, in particular, mouse wheel events are received at a 585 // modifiers. On the Mac, in particular, mouse wheel events are received at a
588 // high rate; not waiting for the ack results in jankiness, and using the same 586 // high rate; not waiting for the ack results in jankiness, and using the same
589 // mechanism as for mouse moves (just dropping old events when multiple ones 587 // mechanism as for mouse moves (just dropping old events when multiple ones
590 // would be queued) results in very slow scrolling. 588 // would be queued) results in very slow scrolling.
591 WheelEventQueue coalesced_mouse_wheel_events_; 589 WheelEventQueue coalesced_mouse_wheel_events_;
592 590
591 // True if a touch move event was sent to the renderer view and we are waiting
592 // for a corresponding ACK message.
593 bool touch_move_pending_;
594
595 // If a touch move event comes in while we are waiting for an ACK for a
596 // previously sent touch move event, it will be stored here. A touch event
597 // stores the location of the moved point, instead of the amount that it
598 // moved. So it is not necessary to coalesce the move events (as is done for
599 // mouse wheel events). Storing the most recent event for dispatch is
600 // sufficient.
601 WebKit::WebTouchEvent queued_touch_event_;
602 bool touch_event_is_queued_;
603
593 // The time when an input event was sent to the RenderWidget. 604 // The time when an input event was sent to the RenderWidget.
594 base::TimeTicks input_event_start_time_; 605 base::TimeTicks input_event_start_time_;
595 606
596 // If true, then we should repaint when restoring even if we have a 607 // If true, then we should repaint when restoring even if we have a
597 // backingstore. This flag is set to true if we receive a paint message 608 // backingstore. This flag is set to true if we receive a paint message
598 // while is_hidden_ to true. Even though we tell the render widget to hide 609 // while is_hidden_ to true. Even though we tell the render widget to hide
599 // itself, a paint message could already be in flight at that point. 610 // itself, a paint message could already be in flight at that point.
600 bool needs_repainting_on_restore_; 611 bool needs_repainting_on_restore_;
601 612
602 // This is true if the renderer is currently unresponsive. 613 // This is true if the renderer is currently unresponsive.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 667
657 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_; 668 std::vector<gfx::PluginWindowHandle> deferred_plugin_handles_;
658 669
659 // The last scroll offset of the render widget. 670 // The last scroll offset of the render widget.
660 gfx::Point last_scroll_offset_; 671 gfx::Point last_scroll_offset_;
661 672
662 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost); 673 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHost);
663 }; 674 };
664 675
665 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_ 676 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698