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

Issue 2684973014: Only show Last N Pages in the UI when the corresponding tab is visible. (Closed)

Created:
3 years, 10 months ago by dewittj
Modified:
3 years, 9 months ago
CC:
chromium-reviews, ntp-dev+reviews_chromium.org, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, noyau+watch_chromium.org, agrieve+watch_chromium.org, dimich+watch_chromium.org, fgorski
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Only show Last N Pages in the UI when the corresponding tab is visible. This patch takes two approaches: * NTP suggestions now use a DownloadUIAdapter to manage the set of items on the page. This adapter is notified about tab addition and removal, and only notifies about pages that correspond to a tab. * Deletes pages when a tab is closed.

Patch Set 1 #

Patch Set 2 : Add unit tests #

Total comments: 60

Patch Set 3 : Address comments. #

Total comments: 10

Patch Set 4 : rework delegate ownership. #

Patch Set 5 : Move impl out #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+818 lines, -227 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java View 3 chunks +13 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java View 1 2 3 chunks +72 lines, -0 lines 2 comments Download
M chrome/browser/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/downloads/offline_page_download_bridge.cc View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.h View 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 2 chunks +27 lines, -0 lines 0 comments Download
M chrome/browser/ntp_snippets/content_suggestions_service_factory.cc View 1 2 4 chunks +14 lines, -2 lines 0 comments Download
M components/ntp_snippets/BUILD.gn View 2 chunks +5 lines, -0 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_pages_test_utils.h View 1 chunk +4 lines, -0 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_pages_test_utils.cc View 1 chunk +10 lines, -4 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h View 1 2 4 chunks +19 lines, -28 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc View 1 2 7 chunks +86 lines, -120 lines 0 comments Download
M components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc View 1 2 3 20 chunks +151 lines, -46 lines 0 comments Download
M components/offline_pages/core/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.h View 1 2 3 5 chunks +14 lines, -3 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter.cc View 1 2 3 10 chunks +45 lines, -23 lines 0 comments Download
M components/offline_pages/core/downloads/download_ui_adapter_unittest.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A components/offline_pages/core/recent_tabs/BUILD.gn View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
A components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.h View 1 2 3 1 chunk +85 lines, -0 lines 0 comments Download
A components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc View 1 2 3 1 chunk +97 lines, -0 lines 0 comments Download
A components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate_unittest.cc View 1 2 3 1 chunk +122 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (42 generated)
dewittj
dimich: PTAL fgorski/carlosk: FYI Will add bauerb@ and tedchoc@ when you approve.
3 years, 10 months ago (2017-02-14 21:54:12 UTC) #28
Dmitry Titov
I think fgorski and carlosk are not on reviewer list, but the comment indicates you ...
3 years, 10 months ago (2017-02-14 23:01:03 UTC) #29
carlosk
RSLGTM. https://codereview.chromium.org/2684973014/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java (right): https://codereview.chromium.org/2684973014/diff/120001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java#newcode775 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java:775: sTabModelObservers.put(activity, new RecentTabTracker(tabModelSelector)); nit: you can move this ...
3 years, 10 months ago (2017-02-15 01:20:54 UTC) #33
vitaliii
https://codereview.chromium.org/2684973014/diff/120001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc File chrome/browser/ntp_snippets/content_suggestions_service_factory.cc (right): https://codereview.chromium.org/2684973014/diff/120001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc#newcode45 chrome/browser/ntp_snippets/content_suggestions_service_factory.cc:45: #include "components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.h" Shouldn't this be in OS_ANDROID block? https://codereview.chromium.org/2684973014/diff/120001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc ...
3 years, 10 months ago (2017-02-15 10:12:16 UTC) #34
dewittj
I added fgorski and carlosk on CC list, since they were not required. Now carlosk ...
3 years, 10 months ago (2017-02-15 19:49:45 UTC) #38
vitaliii
ntp_snippets -> LGTM with nits. https://codereview.chromium.org/2684973014/diff/120001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc File components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2684973014/diff/120001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc#newcode235 components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc:235: Mock::VerifyAndClearExpectations(observer()); On 2017/02/15 19:49:45, ...
3 years, 10 months ago (2017-02-16 08:11:04 UTC) #41
tschumann
https://codereview.chromium.org/2684973014/diff/120001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc File components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2684973014/diff/120001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc#newcode235 components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc:235: Mock::VerifyAndClearExpectations(observer()); On 2017/02/16 08:11:04, vitaliii wrote: > On 2017/02/15 ...
3 years, 10 months ago (2017-02-16 09:22:12 UTC) #42
Dmitry Titov
https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc File components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc (right): https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc#newcode38 components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc:38: delegate->set_ui_adapter(recent_tabs_ui_adapter); That is even more hair-raising :) How about ...
3 years, 10 months ago (2017-02-16 23:30:42 UTC) #43
tschumann
https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc File components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc (right): https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc#newcode38 components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc:38: delegate->set_ui_adapter(recent_tabs_ui_adapter); On 2017/02/16 23:30:41, Dmitry Titov wrote: > That ...
3 years, 10 months ago (2017-02-17 11:30:35 UTC) #44
dewittj
https://codereview.chromium.org/2684973014/diff/140001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc File components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2684973014/diff/140001/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc#newcode365 components/ntp_snippets/offline_pages/recent_tab_suggestions_provider_unittest.cc:365: TEST_F(RecentTabSuggestionsProviderTestNoLoad, ShouldFetchOnLoad) { On 2017/02/16 08:11:04, vitaliii wrote: > ...
3 years, 10 months ago (2017-02-17 22:33:38 UTC) #49
dewittj
PTAL, thanks! tedchoc: ChromeActivity.java - This replaces the earlier patch (from https://codereview.chromium.org/2639403003/) and just has ...
3 years, 10 months ago (2017-02-17 22:35:53 UTC) #50
Dmitry Titov
offline pages lgtm
3 years, 10 months ago (2017-02-18 01:45:49 UTC) #53
Ted C
https://codereview.chromium.org/2684973014/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java (right): https://codereview.chromium.org/2684973014/diff/180001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java#newcode773 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java:773: RecentTabTracker previousObserver = I think you can get rid ...
3 years, 10 months ago (2017-02-22 23:28:04 UTC) #55
carlosk
dewittj@ is OOO this week and I'm working on another patch that depends on this ...
3 years, 10 months ago (2017-02-23 03:46:47 UTC) #56
Ted C
On 2017/02/23 03:46:47, carlosk wrote: > dewittj@ is OOO this week and I'm working on ...
3 years, 10 months ago (2017-02-23 18:36:02 UTC) #57
carlosk
On 2017/02/23 18:36:02, Ted C (OOO till Monday) wrote: > On 2017/02/23 03:46:47, carlosk wrote: ...
3 years, 10 months ago (2017-02-24 00:45:12 UTC) #58
tschumann
lgtm https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc File components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc (right): https://codereview.chromium.org/2684973014/diff/140001/components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc#newcode38 components/offline_pages/core/recent_tabs/recent_tabs_ui_adapter_delegate.cc:38: delegate->set_ui_adapter(recent_tabs_ui_adapter); On 2017/02/17 22:33:38, dewittj (OOO 2.20-2.24) wrote: ...
3 years, 10 months ago (2017-02-24 10:40:14 UTC) #59
dewittj
3 years, 9 months ago (2017-02-27 22:28:25 UTC) #60
Message was sent while issue was closed.
thanks for the feedback! This has been superseded by Carlos' patch.  Closing
this issue.

Powered by Google App Engine
This is Rietveld 408576698