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

Issue 2327083002: Ntp: restore scroll position. (Closed)

Created:
4 years, 3 months ago by Michael van Ouwerkerk
Modified:
4 years, 2 months ago
Reviewers:
Bernhard Bauer, Ted C, clamy
CC:
chromium-reviews, jam, darin-cc_chromium.org, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Ntp: restore scroll position. * The scroll position is stored as extra data on the NavigationEntry. * The main use case handled is when the user clicks on a suggested article and then back to view more suggestions. Maintaining scroll position helps maintain context and flow here. * It is the RecyclerView Adapter position that is stored and restored, so if the device is rotated in the meantime, scroll restore will still present the same content as long as the underlying data has not changed. * Because the underlying data is subject to change a few times per day, the scroll position is not persisted. It would be confusing the restore to an old position that now shows different content. BUG=606356 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/22b18a9a6d4f421ddb6d4f74280a571bf7dca4f6 Cr-Commit-Position: refs/heads/master@{#420075}

Patch Set 1 #

Patch Set 2 : Use adapter position and store it in Tab. #

Patch Set 3 : Store scroll position in extra data. #

Patch Set 4 : Cleanups. #

Total comments: 12

Patch Set 5 : Address review comments from bauerb. Fix test build. #

Patch Set 6 : fix build (const) #

Total comments: 4

Patch Set 7 : Adrress review comments from clamy. #

Total comments: 3

Patch Set 8 : Rebase. #

Total comments: 6

Patch Set 9 : Address review comments from tedchoc. #

Patch Set 10 : Reland: Ntp: restore scroll position. #

Messages

Total messages: 64 (41 generated)
Michael van Ouwerkerk
Hi Bernhard, this is the simple approach, which doesn't work. I would probably need to ...
4 years, 3 months ago (2016-09-09 16:09:53 UTC) #4
Michael van Ouwerkerk
Hi Bernhard, this now uses the extra data storage in NavigationEntry itself. It no longer ...
4 years, 3 months ago (2016-09-16 14:39:47 UTC) #16
Bernhard Bauer
Nice! https://codereview.chromium.org/2327083002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2327083002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode835 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:835: return 0; Would it be slightly nicer to ...
4 years, 3 months ago (2016-09-16 15:02:50 UTC) #17
Michael van Ouwerkerk
Thanks! Please take another look. https://codereview.chromium.org/2327083002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2327083002/diff/60001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode835 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:835: return 0; On 2016/09/16 ...
4 years, 3 months ago (2016-09-16 16:35:06 UTC) #21
Michael van Ouwerkerk
Ted, could you take a look please?
4 years, 3 months ago (2016-09-16 16:36:29 UTC) #24
Michael van Ouwerkerk
Camille, could you take a look please as owner of /frame_host/ ?
4 years, 3 months ago (2016-09-16 16:48:38 UTC) #30
Michael van Ouwerkerk
Camille, could you take a look please as owner of /frame_host/ ?
4 years, 3 months ago (2016-09-16 16:48:38 UTC) #31
clamy
https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h#newcode210 content/public/browser/navigation_entry.h:210: virtual const std::map<std::string, base::string16>& GetExtraData() const = 0; I ...
4 years, 3 months ago (2016-09-19 09:49:24 UTC) #34
Michael van Ouwerkerk
https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h#newcode210 content/public/browser/navigation_entry.h:210: virtual const std::map<std::string, base::string16>& GetExtraData() const = 0; On ...
4 years, 3 months ago (2016-09-19 14:27:40 UTC) #35
clamy
https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h#newcode210 content/public/browser/navigation_entry.h:210: virtual const std::map<std::string, base::string16>& GetExtraData() const = 0; On ...
4 years, 3 months ago (2016-09-19 15:25:27 UTC) #36
Michael van Ouwerkerk
Thanks! Please take another look. https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h#newcode210 content/public/browser/navigation_entry.h:210: virtual const std::map<std::string, base::string16>& ...
4 years, 3 months ago (2016-09-19 15:57:39 UTC) #39
Michael van Ouwerkerk
Thanks! Please take another look. https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h File content/public/browser/navigation_entry.h (right): https://codereview.chromium.org/2327083002/diff/100001/content/public/browser/navigation_entry.h#newcode210 content/public/browser/navigation_entry.h:210: virtual const std::map<std::string, base::string16>& ...
4 years, 3 months ago (2016-09-19 15:57:39 UTC) #40
Ted C
https://codereview.chromium.org/2327083002/diff/120001/content/browser/frame_host/navigation_entry_impl.h File content/browser/frame_host/navigation_entry_impl.h (right): https://codereview.chromium.org/2327083002/diff/120001/content/browser/frame_host/navigation_entry_impl.h#newcode362 content/browser/frame_host/navigation_entry_impl.h:362: return extra_data_; Sorry for my delay, but I have ...
4 years, 3 months ago (2016-09-19 16:00:43 UTC) #43
Michael van Ouwerkerk
https://codereview.chromium.org/2327083002/diff/120001/content/browser/frame_host/navigation_entry_impl.h File content/browser/frame_host/navigation_entry_impl.h (right): https://codereview.chromium.org/2327083002/diff/120001/content/browser/frame_host/navigation_entry_impl.h#newcode362 content/browser/frame_host/navigation_entry_impl.h:362: return extra_data_; On 2016/09/19 16:00:43, Ted C wrote: > ...
4 years, 3 months ago (2016-09-19 16:42:02 UTC) #44
Ted C
Overall this looks very reasonable to me, but I'd like to find some way to ...
4 years, 3 months ago (2016-09-19 19:59:08 UTC) #49
Michael van Ouwerkerk
https://codereview.chromium.org/2327083002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java File chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java (right): https://codereview.chromium.org/2327083002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java#newcode680 chrome/android/java/src/org/chromium/chrome/browser/ntp/NewTabPage.java:680: int index = controller.getLastCommittedEntryIndex(); On 2016/09/19 19:59:08, Ted C ...
4 years, 3 months ago (2016-09-20 11:08:17 UTC) #52
Michael van Ouwerkerk
> > > 2.) Do we actually need to expose this? Don't we only need ...
4 years, 3 months ago (2016-09-20 11:10:15 UTC) #53
Ted C
lgtm
4 years, 3 months ago (2016-09-20 17:20:01 UTC) #56
clamy
Thanks! It looks nicer this way, lgtm.
4 years, 3 months ago (2016-09-21 15:29:30 UTC) #57
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/2327083002/160001
4 years, 3 months ago (2016-09-21 15:36:29 UTC) #59
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 3 months ago (2016-09-21 16:15:47 UTC) #61
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/22b18a9a6d4f421ddb6d4f74280a571bf7dca4f6 Cr-Commit-Position: refs/heads/master@{#420075}
4 years, 3 months ago (2016-09-21 16:19:04 UTC) #63
hush (inactive)
4 years, 3 months ago (2016-09-21 20:16:38 UTC) #64
Message was sent while issue was closed.
A revert of this CL (patchset #9 id:160001) has been created in
https://codereview.chromium.org/2363483002/ by hush@chromium.org.

The reason for reverting is: Broke
org.chromium.chrome.browser.ntp.NewTabPageTest.*.

Powered by Google App Engine
This is Rietveld 408576698