Commit 6beb0c71 authored by David Black's avatar David Black Committed by Commit Bot

Modifies AssistantInteractionController for response processing v2.

In response processing v2, the pending response will be committed at
the earliest opportunity so that it can begin rendering.

This CL should *not* affect response processing v1.

Follow up CLs will make additional changes to processing logic and
rendering logic to accommodate this new streaming model.

Bug: b:129411551
Change-Id: I86c22929eb24945f104a06fbbe5ae0b1468caa5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063264
Commit-Queue: David Black <dmblack@google.com>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743211}
parent f2e0aad2
...@@ -147,7 +147,7 @@ class AssistantInteractionController ...@@ -147,7 +147,7 @@ class AssistantInteractionController
void StopActiveInteraction(bool cancel_conversation); void StopActiveInteraction(bool cancel_conversation);
InputModality GetDefaultInputModality() const; InputModality GetDefaultInputModality() const;
AssistantResponse* GetResponseForActiveInteraction();
AssistantVisibility GetVisibility() const; AssistantVisibility GetVisibility() const;
bool IsVisible() const; bool IsVisible() const;
......
...@@ -107,7 +107,7 @@ void AssistantInteractionModel::SetPendingResponse( ...@@ -107,7 +107,7 @@ void AssistantInteractionModel::SetPendingResponse(
pending_response_ = std::move(pending_response); pending_response_ = std::move(pending_response);
} }
void AssistantInteractionModel::FinalizePendingResponse() { void AssistantInteractionModel::CommitPendingResponse() {
DCHECK(pending_response_); DCHECK(pending_response_);
response_ = std::move(pending_response_); response_ = std::move(pending_response_);
NotifyResponseChanged(); NotifyResponseChanged();
......
...@@ -106,16 +106,19 @@ class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantInteractionModel { ...@@ -106,16 +106,19 @@ class COMPONENT_EXPORT(ASSISTANT_MODEL) AssistantInteractionModel {
// Returns the pending response for the interaction. // Returns the pending response for the interaction.
AssistantResponse* pending_response() { return pending_response_.get(); } AssistantResponse* pending_response() { return pending_response_.get(); }
// Finalizes the pending response for the interaction. // Commits the pending response for the interaction. Note that this will cause
void FinalizePendingResponse(); // the previously committed response, if one exists, to be animated off stage
// after which the newly committed response will begin rendering.
void CommitPendingResponse();
// Clears the pending response for the interaction. // Clears the pending response for the interaction.
void ClearPendingResponse(); void ClearPendingResponse();
// Returns the finalized response for the interaction. // Returns the committed response for the interaction.
AssistantResponse* response() { return response_.get(); }
const AssistantResponse* response() const { return response_.get(); } const AssistantResponse* response() const { return response_.get(); }
// Clears the finalized response for the interaction. // Clears the committed response for the interaction.
void ClearResponse(); void ClearResponse();
// Updates the speech level in dB. // Updates the speech level in dB.
......
...@@ -21,6 +21,7 @@ namespace ash { ...@@ -21,6 +21,7 @@ namespace ash {
class AssistantResponseObserver; class AssistantResponseObserver;
class AssistantUiElement; class AssistantUiElement;
// TODO(dmblack): Remove ProcessingState after launch of response processing v2.
// Models a renderable Assistant response. // Models a renderable Assistant response.
// It is refcounted so that views that display the response can safely // It is refcounted so that views that display the response can safely
// reference the data inside this response. // reference the data inside this response.
......
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