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

Issue 2184263005: Add a tab helper to record the last visit date for each bookmark. (Closed)

Created:
4 years, 4 months ago by jkrcal
Modified:
4 years, 4 months ago
CC:
chromium-reviews, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, droger+watchlist_chromium.org, ntp-dev+reviews_chromium.org, Bernhard Bauer
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add a tab helper to record the last visit date for each bookmark. The NTP on Android will display a list of recently visited bookmarks. This CL introduces a tab helper that stores current date to the meta data of a bookmark when the bookmark gets visited. The code is split into a part that depends on content (living in chrome/browser/ntp_snippets) and a platform-independent part (living in components/ntp_snippets). The platform independent code also provides functions to retrieve the list of most recent bookmarks. The code for iOS, analogous to the first part, will come in another CL. BUG=631474

Patch Set 1 #

Total comments: 68

Patch Set 2 : Comments #1 #

Total comments: 18

Patch Set 3 : Comments #2 #

Total comments: 26
Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -1 line) Patch
A chrome/browser/ntp_snippets/bookmark_last_visit_updater.h View 1 2 1 chunk +50 lines, -0 lines 3 comments Download
A chrome/browser/ntp_snippets/bookmark_last_visit_updater.cc View 1 1 chunk +36 lines, -0 lines 2 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 2 chunks +12 lines, -0 lines 5 comments Download
M chrome/chrome_browser.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M components/ntp_snippets.gypi View 1 2 chunks +3 lines, -0 lines 0 comments Download
M components/ntp_snippets/BUILD.gn View 1 2 chunks +3 lines, -0 lines 0 comments Download
A + components/ntp_snippets/bookmarks/DEPS View 1 chunk +3 lines, -1 line 0 comments Download
A components/ntp_snippets/bookmarks/bookmark_last_visit_utils.h View 1 2 1 chunk +41 lines, -0 lines 2 comments Download
A components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc View 1 2 1 chunk +116 lines, -0 lines 14 comments Download

Dependent Patchsets:

Messages

Total messages: 28 (10 generated)
jkrcal
Scott: PTAL at chrome/* Marc: PTAL at components/ntp_snippets/*
4 years, 4 months ago (2016-07-28 16:57:57 UTC) #3
Marc Treib
I also took a look at c/b/ntp_snippets :) https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.cc File chrome/browser/ntp_snippets/ntp_bookmark_helper.cc (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.cc#newcode1 chrome/browser/ntp_snippets/ntp_bookmark_helper.cc:1: // ...
4 years, 4 months ago (2016-07-29 09:54:58 UTC) #4
blundell
https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h File chrome/browser/ntp_snippets/ntp_bookmark_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h#newcode36 chrome/browser/ntp_snippets/ntp_bookmark_helper.h:36: static void CreateForWebContentsWithBookmarkModel( On 2016/07/29 09:54:56, Marc Treib wrote: ...
4 years, 4 months ago (2016-07-29 09:59:23 UTC) #6
tschumann
https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h File chrome/browser/ntp_snippets/ntp_bookmark_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h#newcode30 chrome/browser/ntp_snippets/ntp_bookmark_helper.h:30: class NTPBookmarkHelper nit: I have an issue with any ...
4 years, 4 months ago (2016-07-29 10:18:44 UTC) #8
tschumann
https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h File components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h#newcode28 components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h:28: class BookmarkLastVisitDateHelper so, I'd call this class something like ...
4 years, 4 months ago (2016-07-29 10:33:01 UTC) #9
Marc Treib
https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h File components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h#newcode28 components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h:28: class BookmarkLastVisitDateHelper On 2016/07/29 10:33:00, tschumann wrote: > so, ...
4 years, 4 months ago (2016-07-29 10:42:22 UTC) #10
tschumann
https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h File components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h#newcode28 components/ntp_snippets/bookmarks/bookmark_last_visit_date_helper.h:28: class BookmarkLastVisitDateHelper On 2016/07/29 10:42:22, Marc Treib wrote: > ...
4 years, 4 months ago (2016-07-29 12:38:56 UTC) #11
jkrcal
Thanks! PTAL, again. https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.cc File chrome/browser/ntp_snippets/ntp_bookmark_helper.cc (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.cc#newcode1 chrome/browser/ntp_snippets/ntp_bookmark_helper.cc:1: // Copyright (c) 2012 The Chromium ...
4 years, 4 months ago (2016-07-29 12:42:42 UTC) #12
Marc Treib
https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h File chrome/browser/ntp_snippets/ntp_bookmark_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h#newcode19 chrome/browser/ntp_snippets/ntp_bookmark_helper.h:19: class NavigationHandle; On 2016/07/29 12:42:41, jkrcal wrote: > On ...
4 years, 4 months ago (2016-07-29 14:36:43 UTC) #17
jkrcal
Thanks, again! PTAL. https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h File chrome/browser/ntp_snippets/ntp_bookmark_helper.h (right): https://codereview.chromium.org/2184263005/diff/1/chrome/browser/ntp_snippets/ntp_bookmark_helper.h#newcode19 chrome/browser/ntp_snippets/ntp_bookmark_helper.h:19: class NavigationHandle; On 2016/07/29 14:36:42, Marc ...
4 years, 4 months ago (2016-07-29 15:34:07 UTC) #18
Marc Treib
LGTM with a few more nits https://codereview.chromium.org/2184263005/diff/40001/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc File components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc (right): https://codereview.chromium.org/2184263005/diff/40001/components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc#newcode50 components/ntp_snippets/bookmarks/bookmark_last_visit_utils.cc:50: FormatLastVisitDate(base::Time::Now())); nit: You ...
4 years, 4 months ago (2016-07-30 14:38:09 UTC) #19
sky
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ntp_snippets/bookmark_last_visit_updater.cc File chrome/browser/ntp_snippets/bookmark_last_visit_updater.cc (right): https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ntp_snippets/bookmark_last_visit_updater.cc#newcode14 chrome/browser/ntp_snippets/bookmark_last_visit_updater.cc:14: void BookmarkLastVisitUpdater::CreateForWebContentsWithBookmarkModel( nit: make order match header. https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ntp_snippets/bookmark_last_visit_updater.h File ...
4 years, 4 months ago (2016-08-01 15:15:48 UTC) #20
tschumann
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ntp_snippets/bookmark_last_visit_updater.h File chrome/browser/ntp_snippets/bookmark_last_visit_updater.h (right): https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ntp_snippets/bookmark_last_visit_updater.h#newcode25 chrome/browser/ntp_snippets/bookmark_last_visit_updater.h:25: class BookmarkLastVisitUpdater On 2016/08/01 15:15:47, sky wrote: > Generally ...
4 years, 4 months ago (2016-08-01 16:57:27 UTC) #21
Avi (use Gerrit)
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_helpers.cc File chrome/browser/ui/tab_helpers.cc (right): https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_helpers.cc#newcode82 chrome/browser/ui/tab_helpers.cc:82: #include "chrome/browser/bookmarks/bookmark_model_factory.h" Why is this different than the ANDROID_JAVA_UI ...
4 years, 4 months ago (2016-08-01 17:01:41 UTC) #23
sky
Avi is more familiar with the naming here than I. Avi, do you think they ...
4 years, 4 months ago (2016-08-01 22:37:21 UTC) #24
Philipp Keck
I'm taking over this CL, the new CL is here: https://codereview.chromium.org/2200113002/ Marc's comments are addressed ...
4 years, 4 months ago (2016-08-02 13:05:34 UTC) #25
Ted C
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_helpers.cc File chrome/browser/ui/tab_helpers.cc (right): https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_helpers.cc#newcode82 chrome/browser/ui/tab_helpers.cc:82: #include "chrome/browser/bookmarks/bookmark_model_factory.h" On 2016/08/02 13:05:33, Philipp Keck wrote: > ...
4 years, 4 months ago (2016-08-03 01:11:40 UTC) #27
Philipp Keck
4 years, 4 months ago (2016-08-04 13:18:05 UTC) #28
On 2016/08/03 01:11:40, Ted C wrote:
>
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_h...
> File chrome/browser/ui/tab_helpers.cc (right):
> 
>
https://codereview.chromium.org/2184263005/diff/40001/chrome/browser/ui/tab_h...
> chrome/browser/ui/tab_helpers.cc:82: #include
> "chrome/browser/bookmarks/bookmark_model_factory.h"
> On 2016/08/02 13:05:33, Philipp Keck wrote:
> > On 2016/08/01 17:01:41, Avi wrote:
> > > Why is this different than the ANDROID_JAVA_UI block above here and
> therefore
> > in
> > > need of its own header block?
> > 
> > The only documentation I found on these flags is this:
> >
>
https://codesearch.chromium.org/chromium/src/chrome/common/features.gni?q=and...
> > 
> > So, if I understood that correctly, ANDROID_JAVA_UI is the subset of those
> > OS_ANDROID where we don't only compile for the Android platform, but also
use
> > the whole Java UI stuff listed there.
> > 
> > Most things in the header block above seem to be pretty UI specific ("zoom",
> > "banners", and everything from c/b/ui). The AppBannerManager, for instance,
is
> > only compiled if ANDROID_JAVA_UI is set
> >
>
(https://codesearch.chromium.org/chromium/src/chrome/chrome_browser.gypi?q=app...).
> > So probably that's the reason why they are in that section.
> > 
> > The BookmarkLastVisitUpdater needs to run on all OS_ANDROID and all its
> > dependencies are compiled for OS_ANDROID, not only for ANDROID_JAVA_UI. So
if
> we
> > use ANDROID_JAVA_UI here, we're missing the cases where OS_ANDROID &&
> > !ANDROID_JAVA_UI.
> > 
> > According to bauerb@, those cases might not exist, because the two are
always
> > the same (the gni file linked above also indicates that). If, in the future,
> > ANDROID_JAVA_UI is removed completely, the two header blocks can become one
> > again. Probably the right direction would be to use OS_ANDROID throughout
this
> > file, but I don't want to do these changes on this CL.
> > 
> > If you prefer, we can use ANDROID_JAVA_UI (below) instead of OS_ANDROID in
> this
> > file for consistency, even though it seems to be the deprecated one.
> 
> Does this code work with the webui based NTP or just the java based android
one?
> 
> If the latter, then it seems pretty straight forward to follow the conventions
> of
> ANDROID_JAVA_UI.
> 
> You are correct that the current state of the world is somewhat confusing.
> ANDROID_JAVA_UI was introduced with the hope that we could sever the pretty
> strong dependencies we have in the code that on Android we are using the
> java based UI.  OS_ANDROID would remain for things that apply on Android
> regardless of the UI built on top.
> 
> While this might conceptually fall into the latter, I'd be very strongly
tempted
> to leave it in ANDROID_JAVA_UI in this class for consistency (especially if
> the logic only applies to the java NTP).
> 
> I'll try to figure out from sievers@ (the introducer of ANDROID_JAVA_UI) what
> the goals are so we can avoid this going forward, but I'd vote (for this
change)
> that we err on the side of consistency.

Sorry, didn't see this comment.

Yes, it is currently only used with the Java based Android UI.
The new CL
(https://codereview.chromium.org/2200113002/diff/140001/chrome/browser/ui/tab_...)
does not change anything about the flags, for consistency as you recommended.

Powered by Google App Engine
This is Rietveld 408576698