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

Issue 1388293002: Notify WebContentsObservers of user interactions. (Closed)

Created:
5 years, 2 months ago by dominickn
Modified:
5 years, 1 month ago
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, creis+watch_chromium.org, darin-cc_chromium.org, chrome-apps-syd-reviews_chromium.org, tdresser
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Notify WebContentsObservers of user interactions. This CL allows web contents observers to receive notifications of user input when the contents is focused. User input is taken to be one of: 1. mouse down event 2. raw key down event 3. gesture tap event The type of input is propagated to the observer, but all other details are suppressed. This extends the existing WebContentsObserver::OnUserGesture in two ways: 1. firing on all raw keypress events, instead of only enter and space; 2. providing the input type that triggered the call. This CL refactors the site engagement service to use the new user interaction notification in place of registering input callbacks on RenderWidgetHost. It is intended that other consumers of WebContentsObserver::OnUserGesture will be migrated to this new method in a follow-up CL. Consumers of the RenderWidgetHost mouse and keypress callback API may also be migrated to this method. BUG=548011, 464234 Committed: https://crrev.com/2dd142dd17f23127ac4a135363fe2580359150d6 Cr-Commit-Position: refs/heads/master@{#356772}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressing reviewer feedback #

Total comments: 4

Patch Set 3 : Refactoring site engagement to use DidGetUserInteraction #

Total comments: 7

Patch Set 4 : Moving impl to RenderWidgetHost #

Total comments: 8

Patch Set 5 : Adding histogram. Addressing reviewer feedback #

Total comments: 5

Patch Set 6 : Inlining RenderWidgetHost::OnUserInteraction #

Total comments: 3

Patch Set 7 : Addressing nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+454 lines, -603 lines) Patch
M chrome/browser/engagement/site_engagement_helper.h View 1 2 3 4 5 6 2 chunks +19 lines, -37 lines 0 comments Download
M chrome/browser/engagement/site_engagement_helper.cc View 1 2 3 4 5 6 5 chunks +40 lines, -100 lines 0 comments Download
A chrome/browser/engagement/site_engagement_helper_unittest.cc View 1 2 3 4 5 6 1 chunk +362 lines, -0 lines 0 comments Download
M chrome/browser/engagement/site_engagement_metrics.h View 1 2 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/engagement/site_engagement_service.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
D chrome/browser/engagement/site_engagement_service_browsertest.cc View 1 2 1 chunk +0 lines, -464 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_delegate.h View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_impl.cc View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M content/public/browser/web_contents_observer.h View 1 2 3 2 chunks +8 lines, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 31 (12 generated)
jdduke (slow)
Either this or the observer callback approach we discussed are fine, IMO. https://codereview.chromium.org/1388293002/diff/1/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc ...
5 years, 2 months ago (2015-10-21 20:53:52 UTC) #2
dominickn
Thanks! https://codereview.chromium.org/1388293002/diff/1/content/browser/renderer_host/render_widget_host_impl.cc File content/browser/renderer_host/render_widget_host_impl.cc (right): https://codereview.chromium.org/1388293002/diff/1/content/browser/renderer_host/render_widget_host_impl.cc#newcode1110 content/browser/renderer_host/render_widget_host_impl.cc:1110: if (key_event.type == WebKeyboardEvent::RawKeyDown) On 2015/10/21 20:53:51, jdduke ...
5 years, 1 month ago (2015-10-26 04:14:24 UTC) #3
jdduke (slow)
No bug? I think this is fine, main nit here is to keep the naming ...
5 years, 1 month ago (2015-10-26 16:02:53 UTC) #4
nasko
A drive by review. Please include a BUG with details why this is needed. Also, ...
5 years, 1 month ago (2015-10-26 17:18:44 UTC) #6
dominickn
@calamity: please review site engagement stuff. @jdduke/@nasko: I've now filed a bug. There wasn't one ...
5 years, 1 month ago (2015-10-27 07:03:57 UTC) #11
nasko
My main overall concern is whether this will be a performance concern, especially as mouse ...
5 years, 1 month ago (2015-10-27 13:41:19 UTC) #12
dominickn
Given your concern about mouse wheel events and scrolling performance, I've removed them as triggers ...
5 years, 1 month ago (2015-10-27 23:21:53 UTC) #13
calamity
lgtm. It's unfortunate that we lose mouse scrolls as an engagement event. Perhaps we can ...
5 years, 1 month ago (2015-10-28 03:00:25 UTC) #15
dominickn
Thanks! Also added histograms.xml which I forgot in the earlier upload. https://codereview.chromium.org/1388293002/diff/60001/chrome/browser/engagement/site_engagement_helper.cc File chrome/browser/engagement/site_engagement_helper.cc (right): ...
5 years, 1 month ago (2015-10-28 03:28:17 UTC) #16
nasko
https://codereview.chromium.org/1388293002/diff/40001/content/public/browser/web_contents_observer.h File content/public/browser/web_contents_observer.h (right): https://codereview.chromium.org/1388293002/diff/40001/content/public/browser/web_contents_observer.h#newcode318 content/public/browser/web_contents_observer.h:318: // with the appropriate filtering by input event type. ...
5 years, 1 month ago (2015-10-28 17:36:12 UTC) #17
dominickn
> I don't have very strong preference which way it happens. I do have a ...
5 years, 1 month ago (2015-10-29 00:03:19 UTC) #18
nasko
LGTM https://codereview.chromium.org/1388293002/diff/80001/content/browser/renderer_host/render_widget_host_impl.h File content/browser/renderer_host/render_widget_host_impl.h (right): https://codereview.chromium.org/1388293002/diff/80001/content/browser/renderer_host/render_widget_host_impl.h#newcode583 content/browser/renderer_host/render_widget_host_impl.h:583: // event; and 3) any gesture tap event ...
5 years, 1 month ago (2015-10-29 00:07:26 UTC) #19
dominickn
Thanks! +isherman: please review histograms.xml.
5 years, 1 month ago (2015-10-29 00:32:27 UTC) #22
Ilya Sherman
histograms.xml lgtm % nit: https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml#newcode72105 tools/metrics/histograms/histograms.xml:72105: + <int value="3" label="Gesture"/> Optional ...
5 years, 1 month ago (2015-10-29 00:38:52 UTC) #24
jdduke (slow)
https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml#newcode72105 tools/metrics/histograms/histograms.xml:72105: + <int value="3" label="Gesture"/> On 2015/10/29 00:38:52, Ilya Sherman ...
5 years, 1 month ago (2015-10-29 00:50:17 UTC) #25
dominickn
Thanks everyone. :) https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/1388293002/diff/120001/tools/metrics/histograms/histograms.xml#newcode72105 tools/metrics/histograms/histograms.xml:72105: + <int value="3" label="Gesture"/> On 2015/10/29 ...
5 years, 1 month ago (2015-10-29 01:48:02 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1388293002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1388293002/140001
5 years, 1 month ago (2015-10-29 03:22:01 UTC) #29
commit-bot: I haz the power
Committed patchset #7 (id:140001)
5 years, 1 month ago (2015-10-29 05:31:00 UTC) #30
commit-bot: I haz the power
5 years, 1 month ago (2015-10-29 05:31:54 UTC) #31
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/2dd142dd17f23127ac4a135363fe2580359150d6
Cr-Commit-Position: refs/heads/master@{#356772}

Powered by Google App Engine
This is Rietveld 408576698