Commit 1e749955 authored by Yue Li's avatar Yue Li Committed by Commit Bot

Quick Answers: Dismiss the view to prevent duplication

Check if the quick answers view is not dismissed when creating new ones
to prevent multiple views showing.

This is also a short term workaround of the view stuck issue.

Bug: b/162596353
Test: Manual Test
Change-Id: I5bc418547077622d637687796196c6de4aa3842e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335755Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yue Li <updowndota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795106}
parent 6042fef3
...@@ -36,7 +36,14 @@ void QuickAnswersUiController::CreateQuickAnswersView( ...@@ -36,7 +36,14 @@ void QuickAnswersUiController::CreateQuickAnswersView(
const gfx::Rect& bounds, const gfx::Rect& bounds,
const std::string& title, const std::string& title,
const std::string& query) { const std::string& query) {
DCHECK(!quick_answers_view_); // Currently there are timing issues that causes the quick answers view is not
// dismissed. TODO(updowndota): Remove the special handling after the root
// cause is found.
if (quick_answers_view_) {
LOG(ERROR) << "Quick answers view not dismissed.";
CloseQuickAnswersView();
}
DCHECK(!user_consent_view_); DCHECK(!user_consent_view_);
SetActiveQuery(query); SetActiveQuery(query);
quick_answers_view_ = new QuickAnswersView(bounds, title, this); quick_answers_view_ = new QuickAnswersView(bounds, title, this);
......
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