WebUI NTP: link navigations from NTP should change order of most-visited
The most-visited are populated by history segments which are created for URLs typed in the omnibox (ui::PAGE_TRANSITION_TYPED) and URLs that are loaded from top Chrome bookmarks (ui::PAGE_TRANSITION_AUTO_BOOKMARK). https://source.chromium.org/chromium/chromium/src/+/master:components/history/core/browser/history_backend.cc;l=423;drc=b5056af54caa3a56c0d748bd39d0803ae0312a9b The segments keep a |visit_count|. The segment entries are used to query the top sites from the last 90 days. https://source.chromium.org/chromium/chromium/src/+/master:components/history/core/browser/top_sites_impl.cc;l=241;drc=df87046cb8ae4dbd62cda6e56d317016a6fa02c7 https://source.chromium.org/chromium/chromium/src/+/master:components/history/core/browser/history_backend.cc;l=464;drc=b5056af54caa3a56c0d748bd39d0803ae0312a9b https://source.chromium.org/chromium/chromium/src/+/master:components/history/core/browser/visitsegment_database.cc;l=168;drc=df87046cb8ae4dbd62cda6e56d317016a6fa02c7 The visits to the most-visited on the Android NTP use ui::PAGE_TRANSITION_AUTO_BOOKMARK which means if a user taps on a most-visited tile, the segment's |visit_count| will be incremented. crbug.com/620296 was created so the remote and local NTP would work the same as the Android NTP (most-visited tile clicks will increment the associated segment's |visit_count|. The way this was accomplished was by altering the link navigations when the current site URL has the origins chrome-search://local-ntp or chrome-search://remote-ntp. The transition was changed from ui::PAGE_TRANSITION_LINK to ui::PAGE_TRANSITION_AUTO_BOOKMARK so the navigation would be considered as starting a segment. https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/chrome_content_browser_client.cc;l=1828;drc=c3de1340119b5e6e76cc34248f3310ea05dfaf6f chrome://new-tab-page is replacing chrome-search://local-ntp/local-ntp.html. If adding the transition override for link navigations from the local NTP is still justified, this CL does the same for chrome://new-tab-page. Bug: 1089877 Change-Id: Ib6bea5d04ff95a4c20aaf5d8e90dd857719d83a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2247101Reviewed-by:Charlie Reis <creis@chromium.org> Reviewed-by:
Avi Drissman <avi@chromium.org> Reviewed-by:
Tibor Goldschwendt <tiborg@chromium.org> Commit-Queue: Esmael Elmoslimany <aee@chromium.org> Cr-Commit-Position: refs/heads/master@{#783029}
Showing
Please register or sign in to comment