Commit e19dbbcd authored by Ryan Sturm's avatar Ryan Sturm Committed by Commit Bot

[Previews] Reporting non-opt outs to client blacklist

In a refactor from the InfoBar delegate into the PreviewsUITabHelper, we
stopped reporting non-opt outs to Previews code. This will break
Previews for all users in M71 once they dismiss enough previews (even if
we serve them a lot of Previews they do not dismiss).

Bug: 900711
Change-Id: I1f0e2da1c7421f3ec8668b79b09ad0367e4dce47
Reviewed-on: https://chromium-review.googlesource.com/c/1311118Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604396}
parent 4b6d639d
......@@ -93,7 +93,13 @@ bool ShouldShowUIForPreviewsType(previews::PreviewsType type) {
} // namespace
PreviewsUITabHelper::~PreviewsUITabHelper() {}
PreviewsUITabHelper::~PreviewsUITabHelper() {
// Report a non-opt out for the previous page if it was a preview and was not
// reloaded without previews.
if (!on_dismiss_callback_.is_null()) {
std::move(on_dismiss_callback_).Run(false);
}
}
PreviewsUITabHelper::PreviewsUITabHelper(content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), weak_factory_(this) {
......@@ -240,6 +246,12 @@ void PreviewsUITabHelper::DidFinishNavigation(
!navigation_handle->HasCommitted() || navigation_handle->IsSameDocument())
return;
// Report a non-opt out for the previous page if it was a preview and was not
// reloaded without previews.
if (!on_dismiss_callback_.is_null()) {
std::move(on_dismiss_callback_).Run(false);
}
previews_freshness_ = base::Time();
previews_user_data_.reset();
#if defined(OS_ANDROID)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment