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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 1003023002: Signal input flush when all flings have terminated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compile Created 5 years, 9 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
OLDNEW
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 #include "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 if (delegate_) 387 if (delegate_)
388 delegate_->DidSendScreenRects(this); 388 delegate_->DidSendScreenRects(this);
389 waiting_for_screen_rects_ack_ = true; 389 waiting_for_screen_rects_ack_ = true;
390 } 390 }
391 391
392 void RenderWidgetHostImpl::SuppressNextCharEvents() { 392 void RenderWidgetHostImpl::SuppressNextCharEvents() {
393 suppress_next_char_events_ = true; 393 suppress_next_char_events_ = true;
394 } 394 }
395 395
396 void RenderWidgetHostImpl::FlushInput() { 396 void RenderWidgetHostImpl::FlushInput() {
397 input_router_->Flush(); 397 input_router_->RequestNotificationWhenFlushed();
398 if (synthetic_gesture_controller_) 398 if (synthetic_gesture_controller_)
399 synthetic_gesture_controller_->Flush(base::TimeTicks::Now()); 399 synthetic_gesture_controller_->Flush(base::TimeTicks::Now());
400 } 400 }
401 401
402 void RenderWidgetHostImpl::SetNeedsFlush() { 402 void RenderWidgetHostImpl::SetNeedsFlush() {
403 if (view_) 403 if (view_)
404 view_->OnSetNeedsFlushInput(); 404 view_->OnSetNeedsFlushInput();
405 } 405 }
406 406
407 void RenderWidgetHostImpl::Init() { 407 void RenderWidgetHostImpl::Init() {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition, 453 IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition,
454 OnImeCancelComposition) 454 OnImeCancelComposition)
455 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady) 455 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady)
456 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose) 456 IPC_MESSAGE_HANDLER(ViewHostMsg_Close, OnClose)
457 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK, 457 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateScreenRects_ACK,
458 OnUpdateScreenRectsAck) 458 OnUpdateScreenRectsAck)
459 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove) 459 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnRequestMove)
460 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText) 460 IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnSetTooltipText)
461 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 461 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
462 OnSwapCompositorFrame(msg)) 462 OnSwapCompositorFrame(msg))
463 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopFlinging, OnFlingingStopped)
464 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect) 463 IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnUpdateRect)
465 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus) 464 IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnFocus)
466 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur) 465 IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnBlur)
467 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor) 466 IPC_MESSAGE_HANDLER(ViewHostMsg_SetCursor, OnSetCursor)
468 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged, 467 IPC_MESSAGE_HANDLER(ViewHostMsg_TextInputTypeChanged,
469 OnTextInputTypeChanged) 468 OnTextInputTypeChanged)
470 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse) 469 IPC_MESSAGE_HANDLER(ViewHostMsg_LockMouse, OnLockMouse)
471 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse) 470 IPC_MESSAGE_HANDLER(ViewHostMsg_UnlockMouse, OnUnlockMouse)
472 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup, 471 IPC_MESSAGE_HANDLER(ViewHostMsg_ShowDisambiguationPopup,
473 OnShowDisambiguationPopup) 472 OnShowDisambiguationPopup)
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 ++i) { 1494 ++i) {
1496 rph->OnMessageReceived(*i); 1495 rph->OnMessageReceived(*i);
1497 if (i->dispatch_error()) 1496 if (i->dispatch_error())
1498 rph->OnBadMessageReceived(*i); 1497 rph->OnBadMessageReceived(*i);
1499 } 1498 }
1500 messages_to_deliver_with_frame.clear(); 1499 messages_to_deliver_with_frame.clear();
1501 1500
1502 return true; 1501 return true;
1503 } 1502 }
1504 1503
1505 void RenderWidgetHostImpl::OnFlingingStopped() {
1506 if (view_)
1507 view_->DidStopFlinging();
1508 }
1509
1510 void RenderWidgetHostImpl::OnUpdateRect( 1504 void RenderWidgetHostImpl::OnUpdateRect(
1511 const ViewHostMsg_UpdateRect_Params& params) { 1505 const ViewHostMsg_UpdateRect_Params& params) {
1512 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect"); 1506 TRACE_EVENT0("renderer_host", "RenderWidgetHostImpl::OnUpdateRect");
1513 TimeTicks paint_start = TimeTicks::Now(); 1507 TimeTicks paint_start = TimeTicks::Now();
1514 1508
1515 // Update our knowledge of the RenderWidget's size. 1509 // Update our knowledge of the RenderWidget's size.
1516 current_size_ = params.view_size; 1510 current_size_ = params.view_size;
1517 1511
1518 bool is_resize_ack = 1512 bool is_resize_ack =
1519 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags); 1513 ViewHostMsg_UpdateRect_Flags::is_resize_ack(params.flags);
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1815 } 1809 }
1816 } 1810 }
1817 1811
1818 void RenderWidgetHostImpl::OnHasTouchEventHandlers(bool has_handlers) { 1812 void RenderWidgetHostImpl::OnHasTouchEventHandlers(bool has_handlers) {
1819 has_touch_handler_ = has_handlers; 1813 has_touch_handler_ = has_handlers;
1820 } 1814 }
1821 1815
1822 void RenderWidgetHostImpl::DidFlush() { 1816 void RenderWidgetHostImpl::DidFlush() {
1823 if (synthetic_gesture_controller_) 1817 if (synthetic_gesture_controller_)
1824 synthetic_gesture_controller_->OnDidFlushInput(); 1818 synthetic_gesture_controller_->OnDidFlushInput();
1825 if (view_)
1826 view_->OnDidFlushInput();
1827 } 1819 }
1828 1820
1829 void RenderWidgetHostImpl::DidOverscroll(const DidOverscrollParams& params) { 1821 void RenderWidgetHostImpl::DidOverscroll(const DidOverscrollParams& params) {
1830 if (view_) 1822 if (view_)
1831 view_->DidOverscroll(params); 1823 view_->DidOverscroll(params);
1832 } 1824 }
1833 1825
1826 void RenderWidgetHostImpl::DidStopFlinging() {
1827 if (view_)
1828 view_->DidStopFlinging();
1829 }
1830
1834 void RenderWidgetHostImpl::OnKeyboardEventAck( 1831 void RenderWidgetHostImpl::OnKeyboardEventAck(
1835 const NativeWebKeyboardEvent& event, 1832 const NativeWebKeyboardEvent& event,
1836 InputEventAckState ack_result) { 1833 InputEventAckState ack_result) {
1837 #if defined(OS_MACOSX) 1834 #if defined(OS_MACOSX)
1838 if (!is_hidden() && view_ && view_->PostProcessEventForPluginIme(event)) 1835 if (!is_hidden() && view_ && view_->PostProcessEventForPluginIme(event))
1839 return; 1836 return;
1840 #endif 1837 #endif
1841 1838
1842 // We only send unprocessed key event upwards if we are not hidden, 1839 // We only send unprocessed key event upwards if we are not hidden,
1843 // because the user has moved away from us and no longer expect any effect 1840 // because the user has moved away from us and no longer expect any effect
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 } 2122 }
2126 #endif 2123 #endif
2127 2124
2128 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2125 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2129 if (view_) 2126 if (view_)
2130 return view_->PreferredReadbackFormat(); 2127 return view_->PreferredReadbackFormat();
2131 return kN32_SkColorType; 2128 return kN32_SkColorType;
2132 } 2129 }
2133 2130
2134 } // namespace content 2131 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.h ('k') | content/browser/renderer_host/render_widget_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698