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

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

Issue 2848293002: Adding the Previews infobar to pages that show a client LoFi image (Closed)
Patch Set: sclittle nit Created 3 years, 7 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 3083f0c3483687a308b5bbdb2dee1819fabd85ee..e9996064f4762bcce866364e98d4f567fa385d6d 100644
--- a/chrome/browser/previews/previews_infobar_tab_helper.cc
+++ b/chrome/browser/previews/previews_infobar_tab_helper.cc
@@ -29,11 +29,11 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/offline_pages/offline_page_tab_helper.h"
+#endif // defined(OS_ANDROID)
namespace {
-// Adds the preview navigation to the black list. This method is only used on
-// android currently.
+// Adds the preview navigation to the black list.
void AddPreviewNavigationCallback(content::BrowserContext* browser_context,
const GURL& url,
previews::PreviewsType type,
@@ -48,8 +48,6 @@ void AddPreviewNavigationCallback(content::BrowserContext* browser_context,
} // namespace
-#endif // defined(OS_ANDROID)
-
DEFINE_WEB_CONTENTS_USER_DATA_KEY(PreviewsInfoBarTabHelper);
PreviewsInfoBarTabHelper::~PreviewsInfoBarTabHelper() {
@@ -110,7 +108,7 @@ void PreviewsInfoBarTabHelper::DidFinishNavigation(
data_reduction_proxy_settings &&
data_reduction_proxy_settings->IsDataReductionProxyEnabled(),
base::Bind(&AddPreviewNavigationCallback, browser_context_,
- navigation_handle->GetURL(),
+ navigation_handle->GetRedirectChain()[0],
previews::PreviewsType::OFFLINE));
// Don't try to show other infobars if this is an offline preview.
return;
@@ -123,7 +121,9 @@ void PreviewsInfoBarTabHelper::DidFinishNavigation(
PreviewsInfoBarDelegate::Create(
web_contents(), PreviewsInfoBarDelegate::LITE_PAGE,
true /* is_data_saver_user */,
- PreviewsInfoBarDelegate::OnDismissPreviewsInfobarCallback());
+ base::Bind(&AddPreviewNavigationCallback, browser_context_,
+ navigation_handle->GetRedirectChain()[0],
+ previews::PreviewsType::LITE_PAGE));
}
}

Powered by Google App Engine
This is Rietveld 408576698