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

Issue 2338703003: [NTP] Fix article suggestion clicks contributing to Most Visited tiles (Closed)

Created:
4 years, 3 months ago by mastiz
Modified:
4 years, 1 month ago
CC:
chromium-reviews, sync-reviews_chromium.org, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NTP] Fix article suggestion clicks contributing to Most Visited tiles There's a need to distinguish clicks on different elements on the NTP: a) clicks on Most Visited tiles. b) clicks on (newly introduced) article suggestions (aka snippets). The first should contribute to Most Visited tiles (i.e. boost tiles that have been clicked in the past). The second shouldn't. We do this by introducing a new page transition qualifier, which marks a visit as to-be-ignored. The qualifier is only used for NTP article suggestions for now. History sync is extended analogously to allow server-side generation of Most Visited tiles adopt a similar filtering. We've considered other competing approaches to achieve the same: 1. Use page transition types (LINK vs AUTO_BOOKMARK) to distinguish tile clicks from article suggestion clicks: unfortunately both types have been used in the past (older versions of Chrome). 2. Introduce a dedicated page transition type (split from AUTO_BOOKMARK): this is more intrusive and complex wrt to history sync, since older versions of Chrome would need to deserialize new protos as AUTO_BOOKMARK for backward compatibility. 3. Use the referrer to expose details about which section of the NTP has been clicked: however referrers are required to use http/https or are cleared out otherwise. BUG=645895

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed renaming suggested by bauerb@ #

Patch Set 3 : Restricted to ARTICLES category. #

Total comments: 1

Patch Set 4 #

Total comments: 2

Patch Set 5 : Add test coverage to HistoryBackend. #

Patch Set 6 : Add test coverage to HistoryBackend. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -20 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java View 1 2 3 6 chunks +30 lines, -18 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M components/history/core/browser/history_backend_unittest.cc View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
M components/history/core/browser/history_types.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/sessions/core/serialized_navigation_entry.cc View 1 2 chunks +5 lines, -0 lines 0 comments Download
M components/sessions/core/serialized_navigation_entry_unittest.cc View 1 2 chunks +12 lines, -0 lines 0 comments Download
M components/sync/protocol/session_specifics.proto View 1 1 chunk +3 lines, -0 lines 0 comments Download
M ui/base/page_transition_types.h View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (15 generated)
mastiz
Please take a preliminary look modulo missing unit tests.
4 years, 3 months ago (2016-09-13 13:03:41 UTC) #4
Bernhard Bauer
Looks good, just a naming suggestion: https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h File ui/base/page_transition_types.h (right): https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h#newcode112 ui/base/page_transition_types.h:112: // The visited ...
4 years, 3 months ago (2016-09-13 13:14:40 UTC) #5
Marc Treib
I have another naming suggestion :) https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h File ui/base/page_transition_types.h (right): https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h#newcode113 ui/base/page_transition_types.h:113: PAGE_TRANSITION_IGNORE_FOR_NTP_MOST_VISITED = 0x00400000, ...
4 years, 3 months ago (2016-09-13 13:18:22 UTC) #6
mastiz
PTAL. Tests added. https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h File ui/base/page_transition_types.h (right): https://codereview.chromium.org/2338703003/diff/1/ui/base/page_transition_types.h#newcode112 ui/base/page_transition_types.h:112: // The visited URL won't contribute ...
4 years, 3 months ago (2016-09-13 14:11:55 UTC) #16
mastiz
FYI, I changed the logic in NewTabPage.java to set the qualifier only for the ARTICLES ...
4 years, 3 months ago (2016-09-13 14:30:47 UTC) #17
Bernhard Bauer
LGTM https://codereview.chromium.org/2338703003/diff/40001/components/sessions/core/serialized_navigation_entry_unittest.cc File components/sessions/core/serialized_navigation_entry_unittest.cc (right): https://codereview.chromium.org/2338703003/diff/40001/components/sessions/core/serialized_navigation_entry_unittest.cc#newcode229 components/sessions/core/serialized_navigation_entry_unittest.cc:229: TEST(SerializedNavigationEntryTest, IgnoreForNtpTiles) { Probably for a followup, but ...
4 years, 3 months ago (2016-09-13 15:17:38 UTC) #19
mastiz
sky@chromium.org: please review the overall approach. Detailed discussion in https://groups.google.com/a/google.com/forum/#!topic/chrome-sync-dev/iuO3dwLz-8Y Rationale and some alternatives are ...
4 years, 3 months ago (2016-09-13 15:28:46 UTC) #21
sky
https://codereview.chromium.org/2338703003/diff/60001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2338703003/diff/60001/components/history/core/browser/history_backend.cc#newcode359 components/history/core/browser/history_backend.cc:359: (transition_type & ui::PAGE_TRANSITION_IGNORE_FOR_NTP_TILES) == 0) { Please add coverage ...
4 years, 3 months ago (2016-09-13 19:12:23 UTC) #22
mastiz1
4 years, 3 months ago (2016-09-13 20:52:16 UTC) #24
PTAL

...although an alternative promising idea has been brought up by bauerb@ and
requires investigation: the adoption of data: URLs with a redirect to the target
site. Will follow up on this alternative tomorrow.

https://codereview.chromium.org/2338703003/diff/60001/components/history/core...
File components/history/core/browser/history_backend.cc (right):

https://codereview.chromium.org/2338703003/diff/60001/components/history/core...
components/history/core/browser/history_backend.cc:359: (transition_type &
ui::PAGE_TRANSITION_IGNORE_FOR_NTP_TILES) == 0) {
On 2016/09/13 19:12:23, sky wrote:
> Please add coverage of this to history related unittests.

Done.

Powered by Google App Engine
This is Rietveld 408576698