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

Issue 2439683003: [Android NTP] Move suggestions in SuggestionSection into a separate TreeNode. (Closed)

Created:
4 years, 2 months ago by Bernhard Bauer
Modified:
4 years, 1 month ago
Reviewers:
dgn
CC:
chromium-reviews, ntp-dev+reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android NTP] Move suggestions in SuggestionSection into a separate TreeNode. This makes SnippetArticle a pure model class that doesn't know about the adapter. Goals of the overall refactoring: 1) Decoupling the various pieces of logic, by moving them from the adapter into the tree structure. For example, dismissal is something that could be handled by a TreeNode instead of doing the big switch statement we have right now in the Adapter. 2) Stabilizing the structure of the tree. Right now we tend to throw away everything and rebuild, which means we have to manually figure out what changes exactly to notify about (cf. removeSuggestion). If we keep the tree structure stable and just adjust the number of children below each node as necessary (like SigninPromo already does), we get correct notifications for free, and it will allow for some optimizations as well (we could cache the number of children for each node and update it incrementally when a subtree changes. Right now we'd have to contort ourselves a bit to make that work with things like resetChildren()). BUG=616090 Committed: https://crrev.com/311b9cac063765ab69fb69f76c84bdeba8f722e3 Cr-Commit-Position: refs/heads/master@{#427060}

Patch Set 1 #

Patch Set 2 : rebase #

Total comments: 2

Patch Set 3 : review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -24 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java View 1 2 4 chunks +36 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticle.java View 2 chunks +1 line, -23 lines 0 comments Download

Messages

Total messages: 27 (19 generated)
Bernhard Bauer
Please review.
4 years, 2 months ago (2016-10-21 15:37:06 UTC) #12
dgn
https://codereview.chromium.org/2439683003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java (right): https://codereview.chromium.org/2439683003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java#newcode41 chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java:41: private final List<SnippetArticle> mSuggestions; I find it a bit ...
4 years, 2 months ago (2016-10-21 17:13:30 UTC) #13
Bernhard Bauer
https://codereview.chromium.org/2439683003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java (right): https://codereview.chromium.org/2439683003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java#newcode41 chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java:41: private final List<SnippetArticle> mSuggestions; On 2016/10/21 17:13:30, dgn wrote: ...
4 years, 2 months ago (2016-10-22 16:43:48 UTC) #16
dgn
On 2016/10/22 16:43:48, Bernhard Bauer wrote: > https://codereview.chromium.org/2439683003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java > File > chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java > (right): > ...
4 years, 1 month ago (2016-10-24 12:14:42 UTC) #19
Bernhard Bauer
On 2016/10/24 12:14:42, dgn wrote: > On 2016/10/22 16:43:48, Bernhard Bauer wrote: > > > ...
4 years, 1 month ago (2016-10-24 12:57:18 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2439683003/40001
4 years, 1 month ago (2016-10-24 12:57:47 UTC) #23
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-10-24 13:47:17 UTC) #25
commit-bot: I haz the power
4 years, 1 month ago (2016-10-24 13:51:55 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/311b9cac063765ab69fb69f76c84bdeba8f722e3
Cr-Commit-Position: refs/heads/master@{#427060}

Powered by Google App Engine
This is Rietveld 408576698