Commit 81c86d16 authored by Li Lin's avatar Li Lin Committed by Commit Bot

Add eligibility check when trying to show quick answers.

It was previously gated in context menu. We moved the check to
QuickAnswersController now.

Bug: b/157602163
Test: manual
Change-Id: Ia181ab66bc6fb60c991e59939f037f94b8ec3afc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2219115Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Li Lin <llin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772751}
parent 26fc0e3f
......@@ -49,6 +49,9 @@ void QuickAnswersControllerImpl::MaybeShowQuickAnswers(
const gfx::Rect& anchor_bounds,
const std::string& title,
const Context& context) {
if (!is_eligible_)
return;
// Cache anchor-bounds and query.
anchor_bounds_ = anchor_bounds;
// Initially, title is same as query. Title and query can be overridden based
......@@ -84,9 +87,6 @@ void QuickAnswersControllerImpl::MaybeShowQuickAnswers(
}
void QuickAnswersControllerImpl::DismissQuickAnswers(bool is_active) {
if (!is_eligible_)
return;
MaybeDismissQuickAnswersConsent();
quick_answers_ui_controller_->CloseQuickAnswersView();
quick_answers_client_->OnQuickAnswersDismissed(
......
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