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

Issue 2627603002: [NTP::SectionOrder] Propagate category rank from UI through the bridge. (Closed)

Created:
3 years, 11 months ago by vitaliii
Modified:
3 years, 11 months ago
CC:
chromium-reviews, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org, agrieve+watch_chromium.org, mastiz
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[NTP::SectionOrder] Propagate category rank from UI through the bridge. Provide category rank in |onSuggestionOpened| notification of the bridge. Reasons: we need it for metrics and the rank may have changed after the NTP was opened, so UI is the only place to get "real" rank. BUG=678623 Review-Url: https://codereview.chromium.org/2627603002 Cr-Commit-Position: refs/heads/master@{#444048} Committed: https://chromium.googlesource.com/chromium/src/+/1e86736a8f02a0506d02148b112fcca44fb5ece4

Patch Set 1 : #

Total comments: 2

Patch Set 2 : rebase. #

Patch Set 3 : dgn@ comments. #

Patch Set 4 : rebase. #

Patch Set 5 : rebase. #

Patch Set 6 : java tests. #

Total comments: 6

Patch Set 7 : clean rebase. #

Patch Set 8 : 1-based categoryRank -> 0-based categoryIndex. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -16 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java View 1 2 3 4 5 6 7 1 chunk +8 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPageView.java View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java View 1 2 3 4 5 6 7 2 chunks +5 lines, -2 lines 2 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SuggestionsSection.java View 1 2 3 4 5 6 7 4 chunks +19 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetArticleViewHolder.java View 1 2 3 4 5 6 7 4 chunks +6 lines, -4 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SnippetsBridge.java View 1 2 3 4 5 6 7 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsActivity.java View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/ntp/snippets/ArticleSnippetsTest.java View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 67 (29 generated)
vitaliii
Hi dgn@, Could you have a look please?
3 years, 11 months ago (2017-01-10 12:01:55 UTC) #3
dgn
How about this instead: - Move the SnippetsBridge#onSuggestionOpened out of NtpManager#openSnippet, to something like NtpManager#trackSnippetOpened ...
3 years, 11 months ago (2017-01-11 11:44:18 UTC) #4
dgn
context: I'm currently looking into cleaning up do-all methods like openSnippets is currently, and having ...
3 years, 11 months ago (2017-01-11 11:46:59 UTC) #5
vitaliii
On 2017/01/11 11:46:59, dgn wrote: > context: I'm currently looking into cleaning up do-all methods ...
3 years, 11 months ago (2017-01-12 08:44:37 UTC) #6
tschumann
On 2017/01/12 08:44:37, vitaliii wrote: > On 2017/01/11 11:46:59, dgn wrote: > > context: I'm ...
3 years, 11 months ago (2017-01-12 09:47:29 UTC) #7
dgn
Yes of course, I didn't mean to change anything in the C++ side. The categoryInfo ...
3 years, 11 months ago (2017-01-12 10:46:57 UTC) #8
tschumann
On 2017/01/12 10:46:57, dgn wrote: > Yes of course, I didn't mean to change anything ...
3 years, 11 months ago (2017-01-12 10:53:06 UTC) #9
dgn
Understood. As I said I don't feel too strongly about this specific point now as ...
3 years, 11 months ago (2017-01-12 12:20:19 UTC) #10
vitaliii
Hi dgn@, I addressed your comments. However, the categoryRank is still stored in SuggestionsList. Could ...
3 years, 11 months ago (2017-01-12 15:45:54 UTC) #13
dgn
lgtm
3 years, 11 months ago (2017-01-12 16:18:03 UTC) #16
vitaliii
Hi jkrcal@, could you have a look at ntp_snippets_bridge.* please?
3 years, 11 months ago (2017-01-16 07:00:57 UTC) #20
jkrcal
On 2017/01/16 07:00:57, vitaliii wrote: > Hi jkrcal@, > > could you have a look ...
3 years, 11 months ago (2017-01-16 09:47:59 UTC) #27
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/2627603002/120001
3 years, 11 months ago (2017-01-16 09:56:19 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/342625)
3 years, 11 months ago (2017-01-16 10:03:03 UTC) #32
vitaliii
Hi treib@, could you have a look at ntp_snippets_bridge.*?
3 years, 11 months ago (2017-01-16 11:14:21 UTC) #34
Marc Treib
https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 chrome/browser/android/ntp/ntp_snippets_bridge.cc:355: DCHECK_GT(category_rank, 0); Is this 1-based?!
3 years, 11 months ago (2017-01-16 11:23:05 UTC) #35
vitaliii
Hi treib@, PTAL. https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 chrome/browser/android/ntp/ntp_snippets_bridge.cc:355: DCHECK_GT(category_rank, 0); On 2017/01/16 11:23:05, Marc ...
3 years, 11 months ago (2017-01-16 11:36:17 UTC) #36
Marc Treib
https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 chrome/browser/android/ntp/ntp_snippets_bridge.cc:355: DCHECK_GT(category_rank, 0); On 2017/01/16 11:36:17, vitaliii wrote: > On ...
3 years, 11 months ago (2017-01-16 12:28:52 UTC) #37
vitaliii
tshchumann@, It was your idea to use "rank", do you mind 0-based "index" instead to ...
3 years, 11 months ago (2017-01-16 12:48:37 UTC) #38
tschumann
+mastiz for input on rank representation. https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 chrome/browser/android/ntp/ntp_snippets_bridge.cc:355: DCHECK_GT(category_rank, 0); On ...
3 years, 11 months ago (2017-01-16 13:45:41 UTC) #40
jkrcal
On 2017/01/16 13:45:41, tschumann wrote: > +mastiz for input on rank representation. > > https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc ...
3 years, 11 months ago (2017-01-16 14:08:11 UTC) #41
tschumann
On 2017/01/16 14:08:11, jkrcal wrote: > On 2017/01/16 13:45:41, tschumann wrote: > > +mastiz for ...
3 years, 11 months ago (2017-01-16 14:16:23 UTC) #42
jkrcal
On 2017/01/16 14:16:23, tschumann wrote: > On 2017/01/16 14:08:11, jkrcal wrote: > > On 2017/01/16 ...
3 years, 11 months ago (2017-01-16 14:28:35 UTC) #43
Marc Treib
On 2017/01/16 14:28:35, jkrcal wrote: > On 2017/01/16 14:16:23, tschumann wrote: > > On 2017/01/16 ...
3 years, 11 months ago (2017-01-16 14:41:17 UTC) #44
chromium-reviews
As far as whether this is good or bad practice, it's explicitly said in the ...
3 years, 11 months ago (2017-01-16 15:08:00 UTC) #45
mastiz
https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 chrome/browser/android/ntp/ntp_snippets_bridge.cc:355: DCHECK_GT(category_rank, 0); On 2017/01/16 13:45:41, tschumann wrote: > On ...
3 years, 11 months ago (2017-01-16 15:22:53 UTC) #47
tschumann
On 2017/01/16 15:22:53, mastiz wrote: > https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc > File chrome/browser/android/ntp/ntp_snippets_bridge.cc (right): > > https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc#newcode355 > ...
3 years, 11 months ago (2017-01-16 15:29:23 UTC) #48
Marc Treib
On 2017/01/16 15:29:23, tschumann wrote: > On 2017/01/16 15:22:53, mastiz wrote: > > > https://codereview.chromium.org/2627603002/diff/120001/chrome/browser/android/ntp/ntp_snippets_bridge.cc ...
3 years, 11 months ago (2017-01-16 15:41:48 UTC) #49
jkrcal
On 2017/01/16 15:41:48, Marc Treib wrote: > On 2017/01/16 15:29:23, tschumann wrote: > > On ...
3 years, 11 months ago (2017-01-16 15:44:57 UTC) #50
tschumann
On 2017/01/16 15:44:57, jkrcal wrote: > On 2017/01/16 15:41:48, Marc Treib wrote: > > On ...
3 years, 11 months ago (2017-01-16 15:48:26 UTC) #51
vitaliii
On 2017/01/16 15:48:26, tschumann wrote: > On 2017/01/16 15:44:57, jkrcal wrote: > > On 2017/01/16 ...
3 years, 11 months ago (2017-01-17 08:57:08 UTC) #52
Marc Treib
On 2017/01/17 08:57:08, vitaliii wrote: > On 2017/01/16 15:48:26, tschumann wrote: > > On 2017/01/16 ...
3 years, 11 months ago (2017-01-17 09:00:50 UTC) #53
vitaliii
I changed 1-based categoryRank to 0-based categoryIndex. Feel free to have a look. Otherwise, I ...
3 years, 11 months ago (2017-01-17 12:49:15 UTC) #56
Marc Treib
On 2017/01/17 12:49:15, vitaliii wrote: > I changed 1-based categoryRank to 0-based categoryIndex. > Feel ...
3 years, 11 months ago (2017-01-17 14:33:09 UTC) #59
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/2627603002/160001
3 years, 11 months ago (2017-01-17 14:40:12 UTC) #62
commit-bot: I haz the power
Committed patchset #8 (id:160001) as https://chromium.googlesource.com/chromium/src/+/1e86736a8f02a0506d02148b112fcca44fb5ece4
3 years, 11 months ago (2017-01-17 14:44:47 UTC) #65
dgn
Sorry, realised a couple of bugs slipped in the CL a bit late. PTAL https://codereview.chromium.org/2627603002/diff/160001/chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java ...
3 years, 11 months ago (2017-01-17 17:53:18 UTC) #66
dgn
3 years, 11 months ago (2017-01-17 18:28:25 UTC) #67
Message was sent while issue was closed.
On 2017/01/17 17:53:18, dgn wrote:
> Sorry, realised a couple of bugs slipped in the CL a bit late. PTAL
> 
>
https://codereview.chromium.org/2627603002/diff/160001/chrome/android/java/sr...
> File
> chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java
> (right):
> 
>
https://codereview.chromium.org/2627603002/diff/160001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java:65:
> if (section != null) section.setCategoryIndex(categoryIndex);
> here, we can decide not to show a section because it's empty. In this case, we
> increment categoryIndex and for UMA purpose we are going to have a hole in the
> reported values. 
> 
> shouldn't we use mSections.size() here?
> 
>
https://codereview.chromium.org/2627603002/diff/160001/chrome/android/java/sr...
>
chrome/android/java/src/org/chromium/chrome/browser/ntp/cards/SectionList.java:98:
> section = new SuggestionsSection(this, mNewTabPageManager, mOfflinePageBridge,
> info);
> here section has no categoryIndex set

Addressed in https://codereview.chromium.org/2618893003/#ps260001

Powered by Google App Engine
This is Rietveld 408576698