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

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

Issue 1388293002: Notify WebContentsObservers of user interactions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding histogram. Addressing reviewer feedback Created 5 years, 1 month 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 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 NotifyRendererUnresponsive(); 1438 NotifyRendererUnresponsive();
1439 } 1439 }
1440 1440
1441 void RenderWidgetHostImpl::RendererIsResponsive() { 1441 void RenderWidgetHostImpl::RendererIsResponsive() {
1442 if (is_unresponsive_) { 1442 if (is_unresponsive_) {
1443 is_unresponsive_ = false; 1443 is_unresponsive_ = false;
1444 NotifyRendererResponsive(); 1444 NotifyRendererResponsive();
1445 } 1445 }
1446 } 1446 }
1447 1447
1448 void RenderWidgetHostImpl::OnUserInteraction(
1449 const blink::WebInputEvent::Type type) {
1450 if (delegate_)
1451 delegate_->OnUserInteraction(type);
nasko 2015/10/28 17:36:12 Why have a separate method for a two line body? Ca
dominickn 2015/10/29 00:03:19 Done.
1452 }
1453
1448 void RenderWidgetHostImpl::ClearDisplayedGraphics() { 1454 void RenderWidgetHostImpl::ClearDisplayedGraphics() {
1449 NotifyNewContentRenderingTimeoutForTesting(); 1455 NotifyNewContentRenderingTimeoutForTesting();
1450 if (view_) 1456 if (view_)
1451 view_->ClearCompositorFrame(); 1457 view_->ClearCompositorFrame();
1452 } 1458 }
1453 1459
1454 void RenderWidgetHostImpl::OnRenderProcessGone(int status, int exit_code) { 1460 void RenderWidgetHostImpl::OnRenderProcessGone(int status, int exit_code) {
1455 // RenderFrameHost owns a RenderWidgetHost when it needs one, in which case 1461 // RenderFrameHost owns a RenderWidgetHost when it needs one, in which case
1456 // it handles destruction. 1462 // it handles destruction.
1457 if (!owned_by_render_frame_host_) { 1463 if (!owned_by_render_frame_host_) {
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS; 1857 return INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS;
1852 1858
1853 if (!process_->HasConnection()) 1859 if (!process_->HasConnection())
1854 return INPUT_EVENT_ACK_STATE_UNKNOWN; 1860 return INPUT_EVENT_ACK_STATE_UNKNOWN;
1855 1861
1856 if (event.type == WebInputEvent::MouseDown || 1862 if (event.type == WebInputEvent::MouseDown ||
1857 event.type == WebInputEvent::GestureTapDown) { 1863 event.type == WebInputEvent::GestureTapDown) {
1858 OnUserGesture(); 1864 OnUserGesture();
1859 } 1865 }
1860 1866
1867 if (event.type == WebInputEvent::MouseDown ||
1868 event.type == WebInputEvent::GestureTapDown ||
1869 event.type == WebInputEvent::RawKeyDown) {
1870 OnUserInteraction(event.type);
1871 }
1872
1861 return view_ ? view_->FilterInputEvent(event) 1873 return view_ ? view_->FilterInputEvent(event)
1862 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED; 1874 : INPUT_EVENT_ACK_STATE_NOT_CONSUMED;
1863 } 1875 }
1864 1876
1865 void RenderWidgetHostImpl::IncrementInFlightEventCount() { 1877 void RenderWidgetHostImpl::IncrementInFlightEventCount() {
1866 increment_in_flight_event_count(); 1878 increment_in_flight_event_count();
1867 if (!is_hidden_) 1879 if (!is_hidden_)
1868 StartHangMonitorTimeout(hung_renderer_delay_); 1880 StartHangMonitorTimeout(hung_renderer_delay_);
1869 } 1881 }
1870 1882
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
2186 } 2198 }
2187 2199
2188 #if defined(OS_WIN) 2200 #if defined(OS_WIN)
2189 gfx::NativeViewAccessible 2201 gfx::NativeViewAccessible
2190 RenderWidgetHostImpl::GetParentNativeViewAccessible() { 2202 RenderWidgetHostImpl::GetParentNativeViewAccessible() {
2191 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL; 2203 return delegate_ ? delegate_->GetParentNativeViewAccessible() : NULL;
2192 } 2204 }
2193 #endif 2205 #endif
2194 2206
2195 } // namespace content 2207 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698