|
|
Chromium Code Reviews|
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. |
DescriptionShowing 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 #Depends on Patchset: Messages
Total messages: 119 (91 generated)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
ryansturm@chromium.org changed reviewers: + megjablon@chromium.org
megjablon: PTAL @ PreviewsInfoBar*
dimich@chromium.org changed reviewers: + dimich@chromium.org
Drive-by: Will this introduce a potentially quirky UX? I've added comments to the bug, wonder what our UX experts think...
Description was changed from ========== Moving Offline Previews to Previews UI This prevents showing the offline pages snackbar and replaces it with the previews infobar. This leaves the Offline omnibox and other UI features. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564 ========== to ========== Moving Offline page info through URLRequest and NavigationHandle Instead of passing provisional information to the offline pages tab helper when the navigation to an offline page is determined, the information should be passed through URLRequest and NavigationHandle as part of ChromeNavigationData. This keeps the information more closely related to the navigation handle instead of the WebContents. DidFinishNavigation remains the point at which the offline information is stored on the tab helper. 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564 ==========
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
ryansturm@chromium.org changed reviewers: + jianli@chromium.org
jianli, dimich: PTAL
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linu...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:33: set_displayed_preview_infobar(false); This still needs to be reset for previews, so that on main frame navigation from one preview page to another the state is reset unless I'm mistaken. Shouldn't we also reset is_showing_offline_preview_ here too? https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:32: // Do nothing if this is full main frame navigation. Not sure what this comment means. We show the UI if we are navigating in the main frame.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... 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 needs to be reset for previews, so that on main frame navigation from > one preview page to another the state is reset unless I'm mistaken. > > Shouldn't we also reset is_showing_offline_preview_ here too? DidStartProvisionalLoadForFrame is deprecated in favor of DidFinishNavigation. Is there any reason why this can't be reset in DidFinishNavigation? https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:32: // Do nothing if this is full main frame navigation. On 2016/10/07 22:05:40, megjablon wrote: > Not sure what this comment means. We show the UI if we are navigating in the > main frame. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (left): https://codereview.chromium.org/2362033002/diff/120001/chrome/browser/preview... 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 2016/10/07 22:05:40, megjablon wrote: > > This still needs to be reset for previews, so that on main frame navigation > from > > one preview page to another the state is reset unless I'm mistaken. > > > > Shouldn't we also reset is_showing_offline_preview_ here too? > > DidStartProvisionalLoadForFrame is deprecated in favor of DidFinishNavigation. > Is there any reason why this can't be reset in DidFinishNavigation? Took another look. Looks like it should work fine. https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:32: // Do nothing if this is not a full main frame navigation. Suggestion: Rather than the double negative // Only show the infobar if this is a full main frame navigation https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:34: !navigation_handle->HasCommitted() || navigation_handle->IsSamePage()) Does a refresh count as same page?
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:32: // Do nothing if this is not a full main frame navigation. On 2016/10/07 22:48:33, megjablon wrote: > Suggestion: Rather than the double negative > // Only show the infobar if this is a full main frame navigation Done. https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper.cc:34: !navigation_handle->HasCommitted() || navigation_handle->IsSamePage()) On 2016/10/07 22:48:33, megjablon wrote: > Does a refresh count as same page? This checks for fragment navigations (i.e. links that scroll the page to a specific location), not reloads.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...)
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/140001/chrome/browser/preview... 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: > On 2016/10/07 22:48:33, megjablon wrote: > > Does a refresh count as same page? > > This checks for fragment navigations (i.e. links that scroll the page to a > specific location), not reloads. Ok cool. https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper_unittest.cc (right): https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:10: #include "base/files/file_path.h" Is this include needed? I may be missing where it's used. Same for a few below. Can you make sure these are all needed? https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:59: context_.CreateRequest(GURL("a.com"), net::IDLE, nullptr); Can this use kTestUrl instead of "a.com"? https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:167: ->NavigateAndCommit(GURL(kTestUrl2)); Can you add a test that checks that when the url remains the same, the displayed state isn't reset? Otherwise we shouldn't need a different url.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
megjablon, jianli: PTAL https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_tab_helper_unittest.cc (right): https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:10: #include "base/files/file_path.h" On 2016/10/10 22:25:13, megjablon wrote: > Is this include needed? I may be missing where it's used. Same for a few below. > Can you make sure these are all needed? Done. https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:59: context_.CreateRequest(GURL("a.com"), net::IDLE, nullptr); On 2016/10/10 22:25:13, megjablon wrote: > Can this use kTestUrl instead of "a.com"? Done. This request is short-lived though, as it is only needed to create the request data, which is then copied to NavigationHandle. I added comments to clarify. https://codereview.chromium.org/2362033002/diff/200001/chrome/browser/preview... chrome/browser/previews/previews_infobar_tab_helper_unittest.cc:167: ->NavigateAndCommit(GURL(kTestUrl2)); On 2016/10/10 22:25:13, megjablon wrote: > Can you add a test that checks that when the url remains the same, the displayed > state isn't reset? Otherwise we shouldn't need a different url. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Description was changed from ========== Moving Offline page info through URLRequest and NavigationHandle Instead of passing provisional information to the offline pages tab helper when the navigation to an offline page is determined, the information should be passed through URLRequest and NavigationHandle as part of ChromeNavigationData. This keeps the information more closely related to the navigation handle instead of the WebContents. DidFinishNavigation remains the point at which the offline information is stored on the tab helper. 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564 ========== to ========== Moving Offline page info through URLRequest and NavigationHandle Instead of passing provisional information to the offline pages tab helper when the navigation to an offline page is determined, the information should be passed through URLRequest and NavigationHandle as part of ChromeNavigationData. This keeps the information more closely related to the navigation handle instead of the WebContents. DidFinishNavigation remains the point at which the offline information is stored on the tab helper. 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564,649148 ==========
ryansturm@chromium.org changed reviewers: + bengr@chromium.org
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Description was changed from ========== Moving Offline page info through URLRequest and NavigationHandle Instead of passing provisional information to the offline pages tab helper when the navigation to an offline page is determined, the information should be passed through URLRequest and NavigationHandle as part of ChromeNavigationData. This keeps the information more closely related to the navigation handle instead of the WebContents. DidFinishNavigation remains the point at which the offline information is stored on the tab helper. 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564,649148 ========== to ========== 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564,649148 ==========
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
jianli: I changed the CL as agreed upon; PTAL.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_androi...)
https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2883: public boolean isShowingOfflinePreview() { We should try to avoid adding more offline related codes into Tab. Instead, you could put them in OfflinePageUtils (see how I did it for getOfflinePageHeaderForReload). FYI, this is per feedback from tedchoc in my previous review. We're going to move offline handling logic from Tab to OfflinePageUtils. https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_tab_helper.cc:181: } nit: empty line https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_tab_helper.h (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_tab_helper.h:45: bool IsOfflinePreview() const; nit: rename to IsShowingOfflinePreview in order to be consistent with other places Also, please change is_offline_preview to is_showing_offline_preview in LoadedOfflinePageInfo. https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_utils.h (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_utils.h:47: // Returns whether the offline page corresponding to |web_contents| is part of The comment is a bit hard to understand. How about: // Returns true if the offline page is shown for previewing purpose.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
jianli: PTAL https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java:2883: public boolean isShowingOfflinePreview() { On 2016/10/25 22:14:16, jianli wrote: > We should try to avoid adding more offline related codes into Tab. Instead, you > could put them in OfflinePageUtils (see how I did it for > getOfflinePageHeaderForReload). > > FYI, this is per feedback from tedchoc in my previous review. We're going to > move offline handling logic from Tab to OfflinePageUtils. Done. https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_tab_helper.cc (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_tab_helper.cc:181: } On 2016/10/25 22:14:16, jianli wrote: > nit: empty line Done. https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_tab_helper.h (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_tab_helper.h:45: bool IsOfflinePreview() const; On 2016/10/25 22:14:16, jianli wrote: > nit: rename to IsShowingOfflinePreview in order to be consistent with other > places > > Also, please change is_offline_preview to is_showing_offline_preview in > LoadedOfflinePageInfo. Done. https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... File chrome/browser/android/offline_pages/offline_page_utils.h (right): https://codereview.chromium.org/2362033002/diff/240001/chrome/browser/android... chrome/browser/android/offline_pages/offline_page_utils.h:47: // Returns whether the offline page corresponding to |web_contents| is part of On 2016/10/25 22:14:16, jianli wrote: > The comment is a bit hard to understand. How about: > // Returns true if the offline page is shown for previewing purpose. Done.
lgtm https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:407: * @return True if an offline preview is being shown. nit: please add comment for webContents parameter https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java:223: || OfflinePageUtils.isShowingOfflinePreview(tab) || !isConnected() Please comment why we exclude offline preview case. https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java:549: * @return True if an offline preview is being shown. nit: add comment for tab parameter
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
ryansturm@chromium.org changed reviewers: + bmcquade@chromium.org - bengr@chromium.org, dimich@chromium.org
removing bengr, and dimich megjablon, bmcquade: PTAL Thanks
lgtm
LGTM % comments "The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again." - Will this be changed before launch? Maybe add a comment where we currently reload? https://codereview.chromium.org/2362033002/diff/260001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_delegate.cc (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/browser/preview... chrome/browser/previews/previews_infobar_delegate.cc:124: InfoBarService::WebContentsFromInfoBar(infobar()); Any reason why this was changed from auto*?
Description was changed from ========== 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. The "show original" functionality is still pending, so if the user is still on a prohibitively slow network the offline page will be shown again. BUG=615564,649148 ========== to ========== 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 ==========
Thanks for the reviews. > "The "show original" functionality is still pending, so if the > user is still on a prohibitively slow network the offline page will be > shown again." - Will this be changed before launch? Maybe add a comment where we > currently reload? Removed this from the description, as this functionality just landed today. https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java:407: * @return True if an offline preview is being shown. On 2016/10/25 23:55:27, jianli wrote: > nit: please add comment for webContents parameter Done. https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageTabObserver.java:223: || OfflinePageUtils.isShowingOfflinePreview(tab) || !isConnected() On 2016/10/25 23:55:27, jianli wrote: > Please comment why we exclude offline preview case. Done. https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... File chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/android/java/sr... chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java:549: * @return True if an offline preview is being shown. On 2016/10/25 23:55:27, jianli wrote: > nit: add comment for tab parameter Done. https://codereview.chromium.org/2362033002/diff/260001/chrome/browser/preview... File chrome/browser/previews/previews_infobar_delegate.cc (right): https://codereview.chromium.org/2362033002/diff/260001/chrome/browser/preview... chrome/browser/previews/previews_infobar_delegate.cc:124: InfoBarService::WebContentsFromInfoBar(infobar()); On 2016/10/26 22:01:11, megjablon wrote: > Any reason why this was changed from auto*? It's unclear from the Style guide if auto is really allowed here, but I prefer declaring types except for iterators. I think I added it for myself and forgot to remove it.
The CQ bit was checked by ryansturm@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bmcquade@chromium.org, jianli@chromium.org, megjablon@chromium.org Link to the patchset: https://codereview.chromium.org/2362033002/#ps280001 (title: "comments")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 ==========
Message was sent while issue was closed.
Committed patchset #15 (id:280001)
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ==========
Message was sent while issue was closed.
Patchset 15 (id:??) landed as https://crrev.com/21364834a65e541369e8895d93695dfaf114056b Cr-Commit-Position: refs/heads/master@{#427902}
Message was sent while issue was closed.
A revert of this CL (patchset #15 id:280001) has been created in https://codereview.chromium.org/2446113008/ by alancutter@chromium.org. The reason for reverting is: The following tests are failing on Android Tests: org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnConnectionTypeChanged_pageNotLoaded org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnDestroyed org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnPageLoadFinished_notConnected org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnPageLoadFinished org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testShowSnackbar_ignoreEventsAfterShownOnce org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testAddObserverForTab org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnUrlUpdated_whenSnackbarShown org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnHidden_afterSnackbarShown org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testOnConnectionTypeChanged_notConnected org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testShowSnackbar_onConnectionTypeChanged org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testAddObserverForTab_whenConnected org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testShowSnackbar_onShown org.chromium.chrome.browser.offlinepages.OfflinePageTabObserverTest#testShowSnackbar_onPageLoadFinished https://uberchromegw.corp.google.com/i/chromium.linux/builders/Android%20Test....
Message was sent while issue was closed.
Description was changed from ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ========== to ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ==========
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by ryansturm@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
ryansturm@chromium.org changed reviewers: + dewittj@chromium.org
dewittj: PTAL @ changes to OfflinePageTabObserver.java and OfflinePageTabObserverTest.java
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by ryansturm@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bmcquade@chromium.org, jianli@chromium.org, megjablon@chromium.org Link to the patchset: https://codereview.chromium.org/2362033002/#ps320001 (title: "java fixes for mocking methods")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ========== to ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ==========
Message was sent while issue was closed.
Committed patchset #17 (id:320001)
Message was sent while issue was closed.
Description was changed from ========== 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 Cr-Commit-Position: refs/heads/master@{#427902} ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 17 (id:??) landed as https://crrev.com/e28ec590f2f8f5103fb724c587d3abc1a6782cb8 Cr-Commit-Position: refs/heads/master@{#428124}
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). |
