Commit 83192b32 authored by David Black's avatar David Black Committed by Commit Bot

Remove Assistant's InputModality::kStylus.

In standalone UI, stylus was both an entry point as well as an input
modality. In embedded UI, stylus is only an entry point.

Removing the now unused input modality.

Bug: b:148080975
Change-Id: I4a86a63a221dc4d5648215c720c17fa547f6fc76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036435Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Commit-Queue: David Black <dmblack@google.com>
Cr-Commit-Position: refs/heads/master@{#738026}
parent fb99e0ea
......@@ -239,10 +239,6 @@ void AssistantDialogPlate::OnInputModalityChanged(
animation_observer_->SetActive();
break;
}
case InputModality::kStylus:
// |InputModality::kStylus| is not used for the embedded UI.
NOTREACHED();
break;
}
}
......@@ -282,10 +278,6 @@ views::View* AssistantDialogPlate::FindFirstFocusableView() {
return textfield_;
case InputModality::kVoice:
return animated_voice_input_toggle_;
case InputModality::kStylus:
// |InputModality::kStylus| is not used for the embedded UI.
NOTREACHED();
return nullptr;
}
}
......@@ -444,10 +436,6 @@ void AssistantDialogPlate::UpdateModalityVisibility() {
case InputModality::kVoice:
voice_layout_container_->SetVisible(true);
break;
case InputModality::kStylus:
// |InputModality::kStylus| is not used for the embedded UI.
NOTREACHED();
break;
}
}
......
......@@ -21,7 +21,6 @@
#include "ash/assistant/util/deep_link_util.h"
#include "ash/assistant/util/histogram_util.h"
#include "ash/public/cpp/android_intent_helper.h"
#include "ash/public/cpp/app_list/app_list_features.h"
#include "ash/public/cpp/ash_pref_names.h"
#include "ash/public/cpp/assistant/assistant_setup.h"
#include "ash/public/cpp/assistant/proactive_suggestions.h"
......@@ -236,30 +235,6 @@ void AssistantInteractionController::OnDeepLinkReceived(
/*query_source=*/AssistantQuerySource::kDeepLink);
}
void AssistantInteractionController::OnUiModeChanged(AssistantUiMode ui_mode,
bool due_to_interaction) {
switch (model_.input_modality()) {
case InputModality::kStylus:
// When the Assistant is not in mini state there should not be an active
// metalayer session. If we were in mini state when the UI mode was
// changed, we need to clean up the metalayer session.
Shell::Get()->highlighter_controller()->AbortSession();
// If the UI mode change was not due to interaction, we should reset the
// default input modality. We don't do this if the change occurred due to
// an Assistant interaction because we might inadvertently stop the active
// interaction by changing input modality. When this is the case, the
// modality will be correctly set in |OnInteractionStarted| if needed.
if (!due_to_interaction)
model_.SetInputModality(GetDefaultInputModality());
break;
case InputModality::kKeyboard:
case InputModality::kVoice:
// No action necessary.
break;
}
}
void AssistantInteractionController::OnUiVisibilityChanged(
AssistantVisibility new_visibility,
AssistantVisibility old_visibility,
......@@ -279,29 +254,6 @@ void AssistantInteractionController::OnUiVisibilityChanged(
}
}
void AssistantInteractionController::OnHighlighterEnabledChanged(
HighlighterEnabledState state) {
switch (state) {
case HighlighterEnabledState::kEnabled:
// Skip setting input modality to stylus when the embedded Assistant
// feature is enabled to prevent highlighter aborting sessions in
// OnUiModeChanged.
if (!app_list_features::IsAssistantLauncherUIEnabled())
model_.SetInputModality(InputModality::kStylus);
break;
case HighlighterEnabledState::kDisabledByUser:
case HighlighterEnabledState::kDisabledBySessionComplete:
model_.SetInputModality(InputModality::kKeyboard);
break;
case HighlighterEnabledState::kDisabledBySessionAbort:
// When metalayer mode has been aborted, no action necessary. Abort occurs
// as a result of an interaction starting, most likely due to hotword
// detection. Setting the input modality in these cases would have the
// unintended consequence of stopping the active interaction.
break;
}
}
void AssistantInteractionController::OnHighlighterSelectionRecognized(
const gfx::Rect& rect) {
assistant_controller_->ui_controller()->ShowUi(AssistantEntryPoint::kStylus);
......@@ -820,14 +772,6 @@ void AssistantInteractionController::OnUiVisible(
return;
}
if (entry_point == AssistantEntryPoint::kStylus) {
// When the embedded Assistant feature is enabled, we call ShowUi(kStylus)
// OnHighlighterSelectionRecognized. But we are not actually using stylus.
if (!app_list_features::IsAssistantLauncherUIEnabled())
model_.SetInputModality(InputModality::kStylus);
return;
}
if (ShouldAttemptWarmerWelcome(entry_point))
AttemptWarmerWelcome();
}
......
......@@ -81,8 +81,6 @@ class AssistantInteractionController
void OnCommittedQueryChanged(const AssistantQuery& assistant_query) override;
// AssistantUiModelObserver:
void OnUiModeChanged(AssistantUiMode ui_mode,
bool due_to_interaction) override;
void OnUiVisibilityChanged(
AssistantVisibility new_visibility,
AssistantVisibility old_visibility,
......@@ -90,7 +88,6 @@ class AssistantInteractionController
base::Optional<AssistantExitPoint> exit_point) override;
// HighlighterController::Observer:
void OnHighlighterEnabledChanged(HighlighterEnabledState state) override;
void OnHighlighterSelectionRecognized(const gfx::Rect& rect) override;
// chromeos::assistant::mojom::AssistantInteractionSubscriber:
......
......@@ -8,7 +8,6 @@
#include <vector>
#include "ash/assistant/assistant_controller.h"
#include "ash/assistant/assistant_interaction_controller.h"
#include "ash/assistant/assistant_ui_controller.h"
#include "ash/public/cpp/shell_window_ids.h"
#include "ash/public/cpp/window_properties.h"
......@@ -241,14 +240,6 @@ void AssistantScreenContextController::OnUiVisibilityChanged(
return;
}
InputModality input_modality = assistant_controller_->interaction_controller()
->model()
->input_modality();
// We don't initiate a cache request if we are using stylus input modality.
if (input_modality == InputModality::kStylus)
return;
// Abort any request in progress and update request state.
screen_context_request_factory_.InvalidateWeakPtrs();
model_.SetRequestState(ScreenContextRequestState::kInProgress);
......
......@@ -24,7 +24,6 @@ class AssistantResponse;
// Enumeration of interaction input modalities.
enum class InputModality {
kKeyboard,
kStylus,
kVoice,
};
......
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