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

Unified Diff: chrome/browser/previews/previews_infobar_tab_helper.cc

Issue 2940083003: Add timestamp to infobar for stale Previews (Closed)
Patch Set: test fixes Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/previews/previews_infobar_tab_helper.cc
diff --git a/chrome/browser/previews/previews_infobar_tab_helper.cc b/chrome/browser/previews/previews_infobar_tab_helper.cc
index 7dcd7d3c606cbc3a0bd21e31d9e6140ec27e7a59..41dd2ffa62bf54af4d7f9743104233b9679b31fd 100644
--- a/chrome/browser/previews/previews_infobar_tab_helper.cc
+++ b/chrome/browser/previews/previews_infobar_tab_helper.cc
@@ -105,6 +105,7 @@ void PreviewsInfoBarTabHelper::DidFinishNavigation(
web_contents()->GetBrowserContext());
PreviewsInfoBarDelegate::Create(
web_contents(), previews::PreviewsType::OFFLINE,
+ base::Time() /* previews_freshness */,
data_reduction_proxy_settings &&
data_reduction_proxy_settings->IsDataReductionProxyEnabled(),
base::Bind(&AddPreviewNavigationCallback, browser_context_,
@@ -118,8 +119,10 @@ void PreviewsInfoBarTabHelper::DidFinishNavigation(
const net::HttpResponseHeaders* headers =
navigation_handle->GetResponseHeaders();
if (headers && data_reduction_proxy::IsLitePagePreview(*headers)) {
+ base::Time previews_freshness;
+ headers->GetDateValue(&previews_freshness);
PreviewsInfoBarDelegate::Create(
- web_contents(), previews::PreviewsType::LITE_PAGE,
+ web_contents(), previews::PreviewsType::LITE_PAGE, previews_freshness,
true /* is_data_saver_user */,
base::Bind(&AddPreviewNavigationCallback, browser_context_,
navigation_handle->GetRedirectChain()[0],

Powered by Google App Engine
This is Rietveld 408576698