Adding back stale previews functionality

This was unintentionally removed, and needs to be added back. In the
future, this might move to DataReductionProxyData.

Bug: 813948
Change-Id: Iee0b5c16fc99860a9682804d1948651b434ab7ea
Reviewed-on: https://chromium-review.googlesource.com/927749
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Tarun Bansal <tbansal@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#538847}(cherry picked from commit 97ba93d3e446d69e3b4311d604e1c027eacf84e9)
Reviewed-on: https://chromium-review.googlesource.com/939651
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/branch-heads/3325@{#611}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
diff --git a/chrome/browser/previews/previews_infobar_tab_helper.cc b/chrome/browser/previews/previews_infobar_tab_helper.cc
index f27c121..e28cb7c 100644
--- a/chrome/browser/previews/previews_infobar_tab_helper.cc
+++ b/chrome/browser/previews/previews_infobar_tab_helper.cc
@@ -149,10 +149,17 @@
         previews_user_data_->committed_previews_type();
     if (main_frame_preview != previews::PreviewsType::NONE &&
         main_frame_preview != previews::PreviewsType::LOFI) {
+      base::Time previews_freshness;
+      if (main_frame_preview == previews::PreviewsType::LITE_PAGE) {
+        const net::HttpResponseHeaders* headers =
+            navigation_handle->GetResponseHeaders();
+        if (headers)
+          headers->GetDateValue(&previews_freshness);
+      }
+
       PreviewsInfoBarDelegate::Create(
-          web_contents(), main_frame_preview,
-          base::Time() /* previews_freshness */, true /* is_data_saver_user */,
-          is_reload,
+          web_contents(), main_frame_preview, previews_freshness,
+          true /* is_data_saver_user */, is_reload,
           base::BindOnce(&AddPreviewNavigationCallback,
                          web_contents()->GetBrowserContext(),
                          navigation_handle->GetRedirectChain()[0],