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

Issue 2342453003: [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, 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 use a rather ugly workaround to achieve this: a HTML page implementing a redirect is baked in using a data: scheme URL. This allows the history backend (as well as server-side implementations) to distinguish the two cases described above. The approach competes with more intrusive/controversial alternatives 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. Introducing a new page transition type or qualifier: this can be considered a layering violation. 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. Verified requirements: - Neither dummy redirects (with data: scheme) nor article suggestions show up in NTP tiles (Most Visited). - No additional network requests. - Dummy redirects not visible in history. - Dummy redirects not shown in omnibox autocomplete. - Chrome History sync propagates the required information (to implement analogous server-side logic). However, the dummy redirect URLs are temporarily user-visible, which is undesirable. BUG=645895

Patch Set 1 #

Total comments: 9

Patch Set 2 : Minor: added missing closing bracket. #

Patch Set 3 : Added TODO as suggested. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -3 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java View 1 2 1 chunk +37 lines, -0 lines 0 comments Download
M chrome/android/java_sources.gni View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/android/junit/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleTest.java View 1 chunk +43 lines, -0 lines 0 comments Download
M components/history/core/browser/history_backend.cc View 1 chunk +13 lines, -1 line 5 comments Download
M components/history/core/browser/history_backend_unittest.cc View 1 chunk +37 lines, -0 lines 0 comments Download
M components/history/core/browser/history_types.h View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (4 generated)
mastiz
Alternative solution to https://codereview.chromium.org/2338703003/
4 years, 3 months ago (2016-09-14 13:11:28 UTC) #4
Marc Treib
Approach LGTM - I like this much better than the transition type qualifier. Not pretty, ...
4 years, 3 months ago (2016-09-14 13:25:14 UTC) #5
mastiz
https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java (right): https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java#newcode207 chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java:207: * data: scheme (which prevents articles from showing up ...
4 years, 3 months ago (2016-09-14 13:46:21 UTC) #6
Marc Treib
https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java (right): https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java#newcode217 chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java:217: if (wrappedUrl == null) return mUrl; On 2016/09/14 13:46:21, ...
4 years, 3 months ago (2016-09-14 13:47:55 UTC) #7
Bernhard Bauer
https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java (right): https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java#newcode217 chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java:217: if (wrappedUrl == null) return mUrl; On 2016/09/14 13:25:14, ...
4 years, 3 months ago (2016-09-14 13:53:08 UTC) #8
Marc Treib
https://codereview.chromium.org/2342453003/diff/1/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/1/components/history/core/browser/history_backend.cc#newcode501 components/history/core/browser/history_backend.cc:501: // autocomplete and most visited). On 2016/09/14 13:53:08, Bernhard ...
4 years, 3 months ago (2016-09-14 13:55:05 UTC) #9
mastiz
On 2016/09/14 13:55:05, Marc Treib wrote: > https://codereview.chromium.org/2342453003/diff/1/components/history/core/browser/history_backend.cc > File components/history/core/browser/history_backend.cc (right): > > https://codereview.chromium.org/2342453003/diff/1/components/history/core/browser/history_backend.cc#newcode501 ...
4 years, 3 months ago (2016-09-14 15:23:57 UTC) #10
mastiz
https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java (right): https://codereview.chromium.org/2342453003/diff/1/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java#newcode217 chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java:217: if (wrappedUrl == null) return mUrl; On 2016/09/14 13:53:08, ...
4 years, 3 months ago (2016-09-14 15:42:51 UTC) #11
mastiz
sky@chromium.org: Please review overall approach. Solution competes with https://codereview.chromium.org/2338703003/
4 years, 3 months ago (2016-09-14 15:44:25 UTC) #13
Bernhard Bauer
On 2016/09/14 15:23:57, mastiz wrote: > On 2016/09/14 13:55:05, Marc Treib wrote: > > > ...
4 years, 3 months ago (2016-09-14 15:45:22 UTC) #14
sky
https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc#newcode502 components/history/core/browser/history_backend.cc:502: if (!has_redirects && Wouldn't this mean the page won't ...
4 years, 3 months ago (2016-09-14 18:01:51 UTC) #15
mastiz
https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc#newcode502 components/history/core/browser/history_backend.cc:502: if (!has_redirects && On 2016/09/14 18:01:51, sky wrote: > ...
4 years, 3 months ago (2016-09-14 18:10:19 UTC) #16
sky
https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc#newcode502 components/history/core/browser/history_backend.cc:502: if (!has_redirects && On 2016/09/14 18:10:18, mastiz wrote: > ...
4 years, 3 months ago (2016-09-14 18:17:49 UTC) #17
mastiz
https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc#newcode502 components/history/core/browser/history_backend.cc:502: if (!has_redirects && On 2016/09/14 18:17:49, sky wrote: > ...
4 years, 3 months ago (2016-09-14 18:22:03 UTC) #18
mastiz
https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc File components/history/core/browser/history_backend.cc (right): https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc#newcode502 components/history/core/browser/history_backend.cc:502: if (!has_redirects && On 2016/09/14 18:22:02, mastiz wrote: > ...
4 years, 3 months ago (2016-09-14 18:40:48 UTC) #19
sky
On Wed, Sep 14, 2016 at 11:22 AM, <mastiz@chromium.org> wrote: > > https://codereview.chromium.org/2342453003/diff/40001/components/history/core/browser/history_backend.cc > File ...
4 years, 3 months ago (2016-09-14 21:19:06 UTC) #20
mastiz
On 2016/09/14 21:19:06, sky wrote: > On Wed, Sep 14, 2016 at 11:22 AM, <mailto:mastiz@chromium.org> ...
4 years, 3 months ago (2016-09-14 22:38:52 UTC) #21
sky
4 years, 3 months ago (2016-09-15 00:14:38 UTC) #22
On 2016/09/14 22:38:52, mastiz wrote:
> On 2016/09/14 21:19:06, sky wrote:
> > On Wed, Sep 14, 2016 at 11:22 AM,  <mailto:mastiz@chromium.org> wrote:
> > >
> > >
> >
>
https://codereview.chromium.org/2342453003/diff/40001/components/history/core...
> > > File components/history/core/browser/history_backend.cc (right):
> > >
> > >
> >
>
https://codereview.chromium.org/2342453003/diff/40001/components/history/core...
> > > components/history/core/browser/history_backend.cc:502: if
> > > (!has_redirects &&
> > > On 2016/09/14 18:17:49, sky wrote:
> > >> On 2016/09/14 18:10:18, mastiz wrote:
> > >> > On 2016/09/14 18:01:51, sky wrote:
> > >> > > Wouldn't this mean the page won't show up in history at all?
> > >> >
> > >> > The article itself (redirectee) gets listed in history, but not the
> > > dummy
> > >> > 'data:' redirect, according to my testing on Android. I don't
> > > however fully
> > >> > understand why this case doesn't get reported as a single navigation
> > > chain
> > >> (i.e.
> > >> > single call to AddPage()).
> > >>
> > >> I believe this change would make it so data urls are never added
> > > though, right?
> > >> That isn't the case today, which would mean for users that have data
> > > urls in top
> > >> sites they would no longer end up getting them (they would slowly
> > > expire).
> > >
> > > More specifically, data URLs with AUTO_BOOKMARK (note for example that
> > > clicks on actual bookmarks are marked with LINK). Your point is still
> > > valid, but it should be rare, and the server-side implementation of
> > > Chrome Suggestions discards such scheme. WDYT?
> > 
> > The server side implementation may ignore that, but not the local
> > implementation, right?
> 
> Correct, the local implementation of say Most Visited (aka Top Sites) would
> (prior to to patch) surface a 'data:' URL.
> 
> > 
> >   -Scott
> > >
> > > https://codereview.chromium.org/2342453003/
> > 
> > -- 
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-reviews" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> email
> > to mailto:chromium-reviews+unsubscribe@chromium.org.
> >

In thinking about the options we shouldn't have to update history at all for
this. I think the right place for not updating history is HistoryTabHelper.
HistoryTabHelper is the one that calls through to update history, is in chrome
code, and is the best place to ignore navigations we don't want persisted.

Powered by Google App Engine
This is Rietveld 408576698