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

Issue 2362033002: Showing previews UI for Offline Previews (Closed)

Created:
4 years, 2 months ago by RyanSturm
Modified:
4 years, 1 month ago
CC:
chili+watch_chromium.org, chromium-reviews, dewittj+watch_chromium.org, dimich+watch_chromium.org, fgorski+watch_chromium.org, petewil+watch_chromium.org, romax+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Showing previews UI for Offline Previews This changes the functionality of is_offline_preview() in OfflinePageTabHelper to check the provisional information as well. Additionally, this CL addresses other consumers of this information that want access to it in DidFinishNavigation. Specifically, PreviewsPageLoadMetricsObserver will access the is_offline_previews bit as will PreviewsInfoBarHelper. This also prevents showing the offline pages snackbar and replaces it with the previews infobar. This leaves the Offline omnibox and other UI features. BUG=615564, 649148 Committed: https://crrev.com/21364834a65e541369e8895d93695dfaf114056b Committed: https://crrev.com/e28ec590f2f8f5103fb724c587d3abc1a6782cb8 Cr-Original-Commit-Position: refs/heads/master@{#427902} Cr-Commit-Position: refs/heads/master@{#428124}

Patch Set 1 #

Patch Set 2 : Adding Unittest coverage #

Patch Set 3 : nit #

Patch Set 4 : platform build fixes #

Patch Set 5 : Reworking provisional commits #

Patch Set 6 : rebase #

Patch Set 7 : Adding Dep #

Total comments: 5

Patch Set 8 : megjablon comments rebase #

Total comments: 5

Patch Set 9 : rebase and megjablon comment #

Patch Set 10 : rebase #

Patch Set 11 : typo #

Total comments: 6

Patch Set 12 : megjablon comments #

Patch Set 13 : Simplified Offline Pages #

Total comments: 8

Patch Set 14 : jianli comments #

Total comments: 8

Patch Set 15 : comments #

Patch Set 16 : . #

Patch Set 17 : java fixes for mocking methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -37 lines) Patch
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/android/junit/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserverTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +31 lines, -6 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_tab_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_tab_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +11 lines, -4 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/android/offline_pages/offline_page_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/previews/previews_infobar_delegate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/previews/previews_infobar_tab_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +8 lines, -5 lines 0 comments Download
M chrome/browser/previews/previews_infobar_tab_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +32 lines, -14 lines 0 comments Download
M chrome/browser/previews/previews_infobar_tab_helper_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +42 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 119 (91 generated)
RyanSturm
megjablon: PTAL @ PreviewsInfoBar*
4 years, 2 months ago (2016-09-23 16:57:39 UTC) #12
Dmitry Titov
Drive-by: Will this introduce a potentially quirky UX? I've added comments to the bug, wonder ...
4 years, 2 months ago (2016-09-23 18:05:47 UTC) #14
RyanSturm
jianli, dimich: PTAL
4 years, 2 months ago (2016-09-30 22:10:05 UTC) #19
megjablon
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc#oldcode33 chrome/browser/previews/previews_infobar_tab_helper.cc:33: set_displayed_preview_infobar(false); This still needs to be reset for previews, ...
4 years, 2 months ago (2016-10-07 22:05:41 UTC) #30
RyanSturm
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc#oldcode33 chrome/browser/previews/previews_infobar_tab_helper.cc:33: set_displayed_preview_infobar(false); On 2016/10/07 22:05:40, megjablon wrote: > This still ...
4 years, 2 months ago (2016-10-07 22:26:34 UTC) #33
megjablon
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/previews/previews_infobar_tab_helper.cc#oldcode33 chrome/browser/previews/previews_infobar_tab_helper.cc:33: set_displayed_preview_infobar(false); On 2016/10/07 22:26:34, Ryan Sturm wrote: > On ...
4 years, 2 months ago (2016-10-07 22:48:33 UTC) #36
RyanSturm
https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/previews/previews_infobar_tab_helper.cc File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/previews/previews_infobar_tab_helper.cc#newcode32 chrome/browser/previews/previews_infobar_tab_helper.cc:32: // Do nothing if this is not a full ...
4 years, 2 months ago (2016-10-07 23:05:48 UTC) #39
megjablon
https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/previews/previews_infobar_tab_helper.cc File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/previews/previews_infobar_tab_helper.cc#newcode34 chrome/browser/previews/previews_infobar_tab_helper.cc:34: !navigation_handle->HasCommitted() || navigation_handle->IsSamePage()) On 2016/10/07 23:05:48, Ryan Sturm wrote: ...
4 years, 2 months ago (2016-10-10 22:25:13 UTC) #50
RyanSturm
megjablon, jianli: PTAL https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc File chrome/browser/previews/previews_infobar_tab_helper_unittest.cc (right): https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/previews/previews_infobar_tab_helper_unittest.cc#newcode10 chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:10: #include "base/files/file_path.h" On 2016/10/10 22:25:13, megjablon ...
4 years, 2 months ago (2016-10-11 02:09:56 UTC) #53
RyanSturm
4 years, 2 months ago (2016-10-20 20:30:30 UTC) #58
RyanSturm
jianli: I changed the CL as agreed upon; PTAL.
4 years, 1 month ago (2016-10-25 17:22:34 UTC) #66
jianli
https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java#newcode2883 chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2883: public boolean isShowingOfflinePreview() { We should try to avoid ...
4 years, 1 month ago (2016-10-25 22:14:16 UTC) #69
RyanSturm
jianli: PTAL https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java#newcode2883 chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2883: public boolean isShowingOfflinePreview() { On 2016/10/25 22:14:16, ...
4 years, 1 month ago (2016-10-25 23:08:26 UTC) #72
jianli
lgtm https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java#newcode407 chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:407: * @return True if an offline preview is ...
4 years, 1 month ago (2016-10-25 23:55:27 UTC) #73
RyanSturm
removing bengr, and dimich megjablon, bmcquade: PTAL Thanks
4 years, 1 month ago (2016-10-26 18:26:26 UTC) #77
Bryan McQuade
lgtm
4 years, 1 month ago (2016-10-26 18:30:02 UTC) #78
megjablon
LGTM % comments "The "show original" functionality is still pending, so if the user is ...
4 years, 1 month ago (2016-10-26 22:01:11 UTC) #79
RyanSturm
Thanks for the reviews. > "The "show original" functionality is still pending, so if the ...
4 years, 1 month ago (2016-10-27 00:01:02 UTC) #81
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/2362033002/280001
4 years, 1 month ago (2016-10-27 00:03:21 UTC) #84
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 1 month ago (2016-10-27 01:13:28 UTC) #86
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/21364834a65e541369e8895d93695dfaf114056b Cr-Commit-Position: refs/heads/master@{#427902}
4 years, 1 month ago (2016-10-27 01:16:03 UTC) #88
alancutter (OOO until 2018)
A revert of this CL (patchset #15 id:280001) has been created in https://codereview.chromium.org/2446113008/ by alancutter@chromium.org. ...
4 years, 1 month ago (2016-10-27 04:23:53 UTC) #89
RyanSturm
dewittj: PTAL @ changes to OfflinePageTabObserver.java and OfflinePageTabObserverTest.java
4 years, 1 month ago (2016-10-27 19:22:14 UTC) #108
dewittj
lgtm
4 years, 1 month ago (2016-10-27 20:13:13 UTC) #111
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/2362033002/320001
4 years, 1 month ago (2016-10-27 20:20:16 UTC) #114
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years, 1 month ago (2016-10-27 20:27:10 UTC) #116
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/e28ec590f2f8f5103fb724c587d3abc1a6782cb8 Cr-Commit-Position: refs/heads/master@{#428124}
4 years, 1 month ago (2016-10-27 20:29:37 UTC) #118
phoglund_chromium
4 years, 1 month ago (2016-10-28 09:39:26 UTC) #119
Message was sent while issue was closed.
A revert of this CL (patchset #17 id:320001) has been created in
https://codereview.chromium.org/2450353005/ by phoglund@chromium.org.

The reason for reverting is: Speculative revert: might have broken a bunch of
infobar tests. This CL is the only infobar-related one in the blamelist. 
https://uberchromegw.corp.google.com/i/chromium.linux/builders/Android%20Test...

For instance
org.chromium.chrome.browser.infobar.InfoBarContainerTest#testCloseTabOnAdd:

junit.framework.AssertionFailedError: expected:<2> but was:<1>
	at
org.chromium.chrome.browser.infobar.InfoBarContainerTest.addInfoBarToCurrentTab(InfoBarContainerTest.java:103)
	at
org.chromium.chrome.browser.infobar.InfoBarContainerTest.testCloseTabOnAdd(InfoBarContainerTest.java:223).

Powered by Google App Engine
This is Rietveld 408576698