Commit 61ee8f21 authored by David Black's avatar David Black Committed by Commit Bot

Hide Assistant UI on deactivation.

Previously we hid Assistant on widget deactivation. Then we removed
that logic to instead use an event handler that dismissed Assistant on
press.

We actually need both since Assistant widget can be deactivated w/o a
press event, such as happens when opening feedback via Alt+Shift+i.

Bug: b:117990949
Change-Id: I75338ef112f5cef3445bf88903adaef2ccd56c48
Reviewed-on: https://chromium-review.googlesource.com/c/1292604Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#601372}
parent 183b0f28
...@@ -73,8 +73,16 @@ void AssistantUiController::RemoveModelObserver( ...@@ -73,8 +73,16 @@ void AssistantUiController::RemoveModelObserver(
void AssistantUiController::OnWidgetActivationChanged(views::Widget* widget, void AssistantUiController::OnWidgetActivationChanged(views::Widget* widget,
bool active) { bool active) {
if (active) if (active) {
container_view_->RequestFocus(); container_view_->RequestFocus();
} else {
// When the Assistant widget is deactivated we should hide Assistant UI.
// We already handle press events happening outside of the UI container but
// this will also handle the case where we are deactivated without a press
// event occurring. This happens, for example, when launching Chrome OS
// feedback using keyboard shortcuts.
HideUi(AssistantSource::kUnspecified);
}
} }
void AssistantUiController::OnWidgetVisibilityChanged(views::Widget* widget, void AssistantUiController::OnWidgetVisibilityChanged(views::Widget* widget,
......
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