[Suggestions] Use SiteSuggestion to identify tiles

Desktop / Chromium - Nicolas Dossou-gbete [chromium.org] - 8 August 2017 08:01 EDT

Replaces URLs by SiteSuggestion where possible as mean of tracking and identifying a tile. SiteSuggestion is an unmutable object that can be safely carried around, and provide more context than a simple URL.

This CL also replaces URLs and arrays of primitives by lists or arrays of SiteSuggestion in tests, in an effort to make them more readable.

Bug: 740905 Change-Id: I33e9cf23a088779213eefc26c66e810b405f0446 Reviewed-on: https://chromium-review.googlesource.com/602243 Commit-Queue: Nicolas Dossou-Gbété

81fe6fb [Suggestions] Use SiteSuggestion to identify tiles
.../chromium/chrome/browser/ntp/NewTabPage.java | 3 +-
.../chrome/browser/suggestions/SiteSuggestion.java | 7 +
.../chromium/chrome/browser/suggestions/Tile.java | 79 ++---------
.../chrome/browser/suggestions/TileGridLayout.java | 11 +-
.../chrome/browser/suggestions/TileGroup.java | 129 ++++++++---------
.../browser/suggestions/TileGroupDelegateImpl.java | 16 ++-
.../chrome/browser/suggestions/TileRenderer.java | 28 ++--
.../chrome/browser/suggestions/TileView.java | 42 ++----
chrome/android/java_sources.gni | 2 -
.../chrome/browser/ntp/NewTabPageLoadTest.java | 2 +-
.../chrome/browser/ntp/NewTabPageTest.java | 53 +++----
.../chrome/browser/ntp/NtpUiCaptureTestData.java | 39 +++---
.../ntp/cards/NewTabPageRecyclerViewTest.java | 16 +--
.../browser/suggestions/FakeMostVisitedSites.java | 112 ---------------
.../browser/suggestions/TileGridLayoutTest.java | 33 ++---
.../chrome/browser/suggestions/TileGroupTest.java | 58 +++++---
.../browser/suggestions/TileGroupUnitTest.java | 152 +++++++++------------
.../chrome/browser/suggestions/TileTest.java | 112 ---------------
chrome/test/android/BUILD.gn | 1 +
.../browser/suggestions/FakeMostVisitedSites.java | 130 ++++++++++++++++++
20 files changed, 409 insertions(+), 616 deletions(-)

Upstream: git.chromium.org


  • Share