Commit 3b9caf90 authored by Donn Denman's avatar Donn Denman Committed by Commit Bot

[TTS] Fix tap recognition in Reader Mode.

Fixes the recent regression with tap gesture recognition in Reader
mode tabs.  Converting a tab to show the simplified view is one of
the rare times when we get a new CVC or WebContents for the same tab.
With this change we check if the tab is connected to a different
WebContents and create a new observer when it is.

BUG=821676

Change-Id: I8ba56ffba42a6ca9c138c2cd1c387e398cc27591
Reviewed-on: https://chromium-review.googlesource.com/962992Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Donn Denman <donnd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543255}
parent 56a75817
...@@ -59,7 +59,9 @@ void ContextualSearchTabHelper::InstallUnhandledTapNotifierIfNeeded( ...@@ -59,7 +59,9 @@ void ContextualSearchTabHelper::InstallUnhandledTapNotifierIfNeeded(
content::WebContents* base_web_contents = content::WebContents* base_web_contents =
content::WebContents::FromJavaWebContents(j_base_web_contents); content::WebContents::FromJavaWebContents(j_base_web_contents);
DCHECK(base_web_contents); DCHECK(base_web_contents);
if (!unhandled_tap_web_contents_observer_) { if (!unhandled_tap_web_contents_observer_ ||
base_web_contents !=
unhandled_tap_web_contents_observer_->web_contents()) {
unhandled_tap_web_contents_observer_.reset( unhandled_tap_web_contents_observer_.reset(
new contextual_search::UnhandledTapWebContentsObserver( new contextual_search::UnhandledTapWebContentsObserver(
base_web_contents, device_scale_factor, base_web_contents, device_scale_factor,
......
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