Commit 7a199a3d authored by Xiaohui Chen's avatar Xiaohui Chen Committed by Commit Bot

Revert "Remove AssistantState::VISIBLE"

This reverts commit 5072afda.

Reason for revert: Breaks long press animation

Original change's description:
> Remove AssistantState::VISIBLE
> 
> Remove the VISIBLE state and use AssistantVisibility instead.
> Also remove obsolete handling for AGSA animations.
> 
> Bug: b/140823590
> Test: Run existing tests
> Change-Id: Id64c5e536dfe6d3e10c9b003c135e76c96a9fee1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1802819
> Commit-Queue: Yue Li <updowndota@chromium.org>
> Reviewed-by: Sam McNally <sammc@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Reviewed-by: Tao Wu <wutao@chromium.org>
> Reviewed-by: Xiaohui Chen <xiaohuic@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#696936}

TBR=xiyuan@chromium.org,sammc@chromium.org,xiaohuic@chromium.org,updowndota@chromium.org,wutao@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: b/140823590
Change-Id: I4e5114bc64f459b0854433405027df3490d4b8a4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829492Reviewed-by: default avatarXiaohui Chen <xiaohuic@chromium.org>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Xiaohui Chen <xiaohuic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700905}
parent bf395bd6
...@@ -435,6 +435,11 @@ void AssistantUiController::OnUiVisibilityChanged( ...@@ -435,6 +435,11 @@ void AssistantUiController::OnUiVisibilityChanged(
AssistantVisibility old_visibility, AssistantVisibility old_visibility,
base::Optional<AssistantEntryPoint> entry_point, base::Optional<AssistantEntryPoint> entry_point,
base::Optional<AssistantExitPoint> exit_point) { base::Optional<AssistantExitPoint> exit_point) {
AssistantState::Get()->NotifyStatusChanged(
new_visibility == AssistantVisibility::kVisible
? mojom::AssistantState::VISIBLE
: mojom::AssistantState::READY);
switch (new_visibility) { switch (new_visibility) {
case AssistantVisibility::kClosed: case AssistantVisibility::kClosed:
// When the UI is closed, we stop the auto close timer as it may be // When the UI is closed, we stop the auto close timer as it may be
......
...@@ -11,6 +11,8 @@ enum AssistantState { ...@@ -11,6 +11,8 @@ enum AssistantState {
NOT_READY = 0, NOT_READY = 0,
// The Assistant service is ready. // The Assistant service is ready.
READY, READY,
// The Assistant UI is showing.
VISIBLE
}; };
enum AssistantAllowedState { enum AssistantAllowedState {
......
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
namespace ash { namespace ash {
namespace { namespace {
constexpr uint8_t kAssistantVisibleAlpha = 255; // 100% alpha constexpr uint8_t kVoiceInteractionRunningAlpha = 255; // 100% alpha
constexpr uint8_t kAssistantInvisibleAlpha = 138; // 54% alpha constexpr uint8_t kVoiceInteractionNotRunningAlpha = 138; // 54% alpha
} // namespace } // namespace
...@@ -93,7 +93,7 @@ void HomeButton::ButtonPressed(views::Button* sender, ...@@ -93,7 +93,7 @@ void HomeButton::ButtonPressed(views::Button* sender,
OnPressed(show_source, event.time_stamp()); OnPressed(show_source, event.time_stamp());
} }
void HomeButton::OnAssistantAvailabilityChanged() { void HomeButton::OnVoiceInteractionAvailabilityChanged() {
SchedulePaint(); SchedulePaint();
} }
...@@ -125,7 +125,7 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) { ...@@ -125,7 +125,7 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) {
// factors. // factors.
float ring_outer_radius_dp = 7.f; float ring_outer_radius_dp = 7.f;
float ring_thickness_dp = 1.5f; float ring_thickness_dp = 1.5f;
if (controller_.IsAssistantAvailable()) { if (controller_.IsVoiceInteractionAvailable()) {
ring_outer_radius_dp = 8.f; ring_outer_radius_dp = 8.f;
ring_thickness_dp = 1.f; ring_thickness_dp = 1.f;
} }
...@@ -138,11 +138,11 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) { ...@@ -138,11 +138,11 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) {
fg_flags.setStyle(cc::PaintFlags::kStroke_Style); fg_flags.setStyle(cc::PaintFlags::kStroke_Style);
fg_flags.setColor(ShelfConfig::Get()->shelf_icon_color()); fg_flags.setColor(ShelfConfig::Get()->shelf_icon_color());
if (controller_.IsAssistantAvailable()) { if (controller_.IsVoiceInteractionAvailable()) {
// active: 100% alpha, inactive: 54% alpha // active: 100% alpha, inactive: 54% alpha
fg_flags.setAlpha(controller_.IsAssistantVisible() fg_flags.setAlpha(controller_.IsVoiceInteractionRunning()
? kAssistantVisibleAlpha ? kVoiceInteractionRunningAlpha
: kAssistantInvisibleAlpha); : kVoiceInteractionNotRunningAlpha);
} }
const float thickness = std::ceil(ring_thickness_dp * dsf); const float thickness = std::ceil(ring_thickness_dp * dsf);
...@@ -151,7 +151,7 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) { ...@@ -151,7 +151,7 @@ void HomeButton::PaintButtonContents(gfx::Canvas* canvas) {
// Make sure the center of the circle lands on pixel centers. // Make sure the center of the circle lands on pixel centers.
canvas->DrawCircle(circle_center, radius, fg_flags); canvas->DrawCircle(circle_center, radius, fg_flags);
if (controller_.IsAssistantAvailable()) { if (controller_.IsVoiceInteractionAvailable()) {
fg_flags.setAlpha(255); fg_flags.setAlpha(255);
const float kCircleRadiusDp = 5.f; const float kCircleRadiusDp = 5.f;
fg_flags.setStyle(cc::PaintFlags::kFill_Style); fg_flags.setStyle(cc::PaintFlags::kFill_Style);
......
...@@ -49,7 +49,7 @@ class ASH_EXPORT HomeButton : public ShelfControlButton, ...@@ -49,7 +49,7 @@ class ASH_EXPORT HomeButton : public ShelfControlButton,
// Called when the availability of a long-press gesture may have changed, e.g. // Called when the availability of a long-press gesture may have changed, e.g.
// when Assistant becomes enabled. // when Assistant becomes enabled.
void OnAssistantAvailabilityChanged(); void OnVoiceInteractionAvailabilityChanged();
// True if the app list is shown for the display containing this button. // True if the app list is shown for the display containing this button.
bool IsShowingAppList() const; bool IsShowingAppList() const;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics.h"
#include "base/metrics/user_metrics_action.h" #include "base/metrics/user_metrics_action.h"
#include "base/timer/timer.h"
#include "chromeos/constants/chromeos_features.h" #include "chromeos/constants/chromeos_features.h"
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "ui/display/screen.h" #include "ui/display/screen.h"
...@@ -29,6 +30,8 @@ ...@@ -29,6 +30,8 @@
namespace ash { namespace ash {
namespace { namespace {
constexpr int kVoiceInteractionAnimationDelayMs = 200;
// Returns true if the button should appear activatable. // Returns true if the button should appear activatable.
bool CanActivate() { bool CanActivate() {
return Shell::Get()->tablet_mode_controller()->InTabletMode() || return Shell::Get()->tablet_mode_controller()->InTabletMode() ||
...@@ -46,11 +49,11 @@ HomeButtonController::HomeButtonController(HomeButton* button) ...@@ -46,11 +49,11 @@ HomeButtonController::HomeButtonController(HomeButton* button)
shell->tablet_mode_controller()->AddObserver(this); shell->tablet_mode_controller()->AddObserver(this);
AssistantState::Get()->AddObserver(this); AssistantState::Get()->AddObserver(this);
// Initialize the Assistant overlay and sync the flags if active user session // Initialize voice interaction overlay and sync the flags if active user
// has already started. This could happen when an external monitor is plugged // session has already started. This could happen when an external monitor
// in. // is plugged in.
if (shell->session_controller()->IsActiveUserSessionStarted()) if (shell->session_controller()->IsActiveUserSessionStarted())
InitializeAssistantOverlay(); InitializeVoiceInteractionOverlay();
} }
HomeButtonController::~HomeButtonController() { HomeButtonController::~HomeButtonController() {
...@@ -71,8 +74,9 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) { ...@@ -71,8 +74,9 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) {
switch (event->type()) { switch (event->type()) {
case ui::ET_GESTURE_TAP: case ui::ET_GESTURE_TAP:
case ui::ET_GESTURE_TAP_CANCEL: case ui::ET_GESTURE_TAP_CANCEL:
if (IsAssistantAvailable()) { if (IsVoiceInteractionAvailable()) {
assistant_overlay_->EndAnimation(); assistant_overlay_->EndAnimation();
assistant_animation_delay_timer_->Stop();
} }
if (CanActivate()) if (CanActivate())
...@@ -81,13 +85,23 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) { ...@@ -81,13 +85,23 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) {
// After animating the ripple, let the button handle the event. // After animating the ripple, let the button handle the event.
return false; return false;
case ui::ET_GESTURE_TAP_DOWN: case ui::ET_GESTURE_TAP_DOWN:
if (IsVoiceInteractionAvailable()) {
assistant_animation_delay_timer_->Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(
kVoiceInteractionAnimationDelayMs),
base::BindOnce(
&HomeButtonController::StartVoiceInteractionAnimation,
base::Unretained(this)));
}
if (CanActivate()) if (CanActivate())
button_->AnimateInkDrop(views::InkDropState::ACTION_PENDING, event); button_->AnimateInkDrop(views::InkDropState::ACTION_PENDING, event);
return false; return false;
case ui::ET_GESTURE_LONG_PRESS: case ui::ET_GESTURE_LONG_PRESS:
// Only consume the long press event if the Assistant is available. // Only consume the long press event if voice interaction is available.
if (!IsAssistantAvailable()) if (!IsVoiceInteractionAvailable())
return false; return false;
base::RecordAction(base::UserMetricsAction( base::RecordAction(base::UserMetricsAction(
...@@ -100,8 +114,8 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) { ...@@ -100,8 +114,8 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) {
AssistantEntryPoint::kLongPressLauncher); AssistantEntryPoint::kLongPressLauncher);
return true; return true;
case ui::ET_GESTURE_LONG_TAP: case ui::ET_GESTURE_LONG_TAP:
// Only consume the long tap event if the Assistant is available. // Only consume the long tap event if voice interaction is available.
if (!IsAssistantAvailable()) if (!IsVoiceInteractionAvailable())
return false; return false;
// This event happens after the user long presses and lifts the finger. // This event happens after the user long presses and lifts the finger.
...@@ -116,7 +130,7 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) { ...@@ -116,7 +130,7 @@ bool HomeButtonController::MaybeHandleGestureEvent(ui::GestureEvent* event) {
} }
} }
bool HomeButtonController::IsAssistantAvailable() { bool HomeButtonController::IsVoiceInteractionAvailable() {
AssistantStateBase* state = AssistantState::Get(); AssistantStateBase* state = AssistantState::Get();
bool settings_enabled = state->settings_enabled().value_or(false); bool settings_enabled = state->settings_enabled().value_or(false);
bool feature_allowed = bool feature_allowed =
...@@ -125,12 +139,11 @@ bool HomeButtonController::IsAssistantAvailable() { ...@@ -125,12 +139,11 @@ bool HomeButtonController::IsAssistantAvailable() {
return assistant_overlay_ && feature_allowed && settings_enabled; return assistant_overlay_ && feature_allowed && settings_enabled;
} }
bool HomeButtonController::IsAssistantVisible() { bool HomeButtonController::IsVoiceInteractionRunning() {
return Shell::Get() // TODO(b/140823590): Update the method name/description and use Assistant
->assistant_controller() // visibility state instead.
->ui_controller() return AssistantState::Get()->assistant_state() ==
->model() mojom::AssistantState::VISIBLE;
->visibility() == AssistantVisibility::kVisible;
} }
void HomeButtonController::OnAppListVisibilityChanged(bool shown, void HomeButtonController::OnAppListVisibilityChanged(bool shown,
...@@ -145,12 +158,12 @@ void HomeButtonController::OnAppListVisibilityChanged(bool shown, ...@@ -145,12 +158,12 @@ void HomeButtonController::OnAppListVisibilityChanged(bool shown,
void HomeButtonController::OnActiveUserSessionChanged( void HomeButtonController::OnActiveUserSessionChanged(
const AccountId& account_id) { const AccountId& account_id) {
button_->OnAssistantAvailabilityChanged(); button_->OnVoiceInteractionAvailabilityChanged();
// Initialize the Assistant overlay when primary user session becomes // Initialize voice interaction overlay when primary user session becomes
// active. // active.
if (Shell::Get()->session_controller()->IsUserPrimary() && if (Shell::Get()->session_controller()->IsUserPrimary() &&
!assistant_overlay_) { !assistant_overlay_) {
InitializeAssistantOverlay(); InitializeVoiceInteractionOverlay();
} }
} }
...@@ -160,14 +173,30 @@ void HomeButtonController::OnTabletModeStarted() { ...@@ -160,14 +173,30 @@ void HomeButtonController::OnTabletModeStarted() {
void HomeButtonController::OnAssistantStatusChanged( void HomeButtonController::OnAssistantStatusChanged(
mojom::AssistantState state) { mojom::AssistantState state) {
button_->OnAssistantAvailabilityChanged(); button_->OnVoiceInteractionAvailabilityChanged();
if (!assistant_overlay_)
return;
switch (state) {
case mojom::AssistantState::READY:
UMA_HISTOGRAM_TIMES(
"VoiceInteraction.OpenDuration",
base::TimeTicks::Now() - voice_interaction_start_timestamp_);
break;
case mojom::AssistantState::NOT_READY:
break;
case mojom::AssistantState::VISIBLE:
voice_interaction_start_timestamp_ = base::TimeTicks::Now();
break;
}
} }
void HomeButtonController::OnAssistantSettingsEnabled(bool enabled) { void HomeButtonController::OnAssistantSettingsEnabled(bool enabled) {
button_->OnAssistantAvailabilityChanged(); button_->OnVoiceInteractionAvailabilityChanged();
} }
void HomeButtonController::StartAssistantAnimation() { void HomeButtonController::StartVoiceInteractionAnimation() {
assistant_overlay_->StartAnimation(false); assistant_overlay_->StartAnimation(false);
} }
...@@ -188,10 +217,11 @@ void HomeButtonController::OnAppListDismissed() { ...@@ -188,10 +217,11 @@ void HomeButtonController::OnAppListDismissed() {
->UpdateShelfVisibility(); ->UpdateShelfVisibility();
} }
void HomeButtonController::InitializeAssistantOverlay() { void HomeButtonController::InitializeVoiceInteractionOverlay() {
assistant_overlay_ = new AssistantOverlay(button_); assistant_overlay_ = new AssistantOverlay(button_);
button_->AddChildView(assistant_overlay_); button_->AddChildView(assistant_overlay_);
assistant_overlay_->SetVisible(false); assistant_overlay_->SetVisible(false);
assistant_animation_delay_timer_ = std::make_unique<base::OneShotTimer>();
} }
} // namespace ash } // namespace ash
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
#include "ash/session/session_observer.h" #include "ash/session/session_observer.h"
#include "base/macros.h" #include "base/macros.h"
namespace base {
class OneShotTimer;
} // namespace base
namespace ui { namespace ui {
class GestureEvent; class GestureEvent;
} // namespace ui } // namespace ui
...@@ -33,16 +37,16 @@ class HomeButtonController : public AppListControllerObserver, ...@@ -33,16 +37,16 @@ class HomeButtonController : public AppListControllerObserver,
explicit HomeButtonController(HomeButton* button); explicit HomeButtonController(HomeButton* button);
~HomeButtonController() override; ~HomeButtonController() override;
// Maybe handles a gesture event based on the event and whether the Assistant // Maybe handles a gesture event based on the event and whether voice
// is available. Returns true if the event is consumed; otherwise, HomeButton // interaction is available. Returns true if the event is consumed; otherwise,
// should pass the event along to Button to consume. // HomeButton should pass the event along to Button to consume.
bool MaybeHandleGestureEvent(ui::GestureEvent* event); bool MaybeHandleGestureEvent(ui::GestureEvent* event);
// Whether the Assistant is available via long-press. // Whether voice interaction is available via long-press.
bool IsAssistantAvailable(); bool IsVoiceInteractionAvailable();
// Whether the Assistant UI currently showing. // Whether voice interaction is currently running.
bool IsAssistantVisible(); bool IsVoiceInteractionRunning();
bool is_showing_app_list() const { return is_showing_app_list_; } bool is_showing_app_list() const { return is_showing_app_list_; }
...@@ -63,10 +67,10 @@ class HomeButtonController : public AppListControllerObserver, ...@@ -63,10 +67,10 @@ class HomeButtonController : public AppListControllerObserver,
void OnAppListShown(); void OnAppListShown();
void OnAppListDismissed(); void OnAppListDismissed();
void StartAssistantAnimation(); void StartVoiceInteractionAnimation();
// Initialize the Assistant overlay. // Initialize the voice interaction overlay.
void InitializeAssistantOverlay(); void InitializeVoiceInteractionOverlay();
// True if the app list is currently showing for the button's display. // True if the app list is currently showing for the button's display.
// This is useful because other app_list_visible functions aren't per-display. // This is useful because other app_list_visible functions aren't per-display.
...@@ -75,9 +79,11 @@ class HomeButtonController : public AppListControllerObserver, ...@@ -75,9 +79,11 @@ class HomeButtonController : public AppListControllerObserver,
// The button that owns this controller. // The button that owns this controller.
HomeButton* const button_; HomeButton* const button_;
// Owned by the button's view hierarchy. Null if the Assistant is not // Owned by the button's view hierarchy. Null if voice interaction is not
// enabled. // enabled.
AssistantOverlay* assistant_overlay_ = nullptr; AssistantOverlay* assistant_overlay_ = nullptr;
std::unique_ptr<base::OneShotTimer> assistant_animation_delay_timer_;
base::TimeTicks voice_interaction_start_timestamp_;
DISALLOW_COPY_AND_ASSIGN(HomeButtonController); DISALLOW_COPY_AND_ASSIGN(HomeButtonController);
}; };
......
...@@ -338,7 +338,7 @@ TEST_F(PaletteTrayTestWithAssistant, MetalayerToolViewCreated) { ...@@ -338,7 +338,7 @@ TEST_F(PaletteTrayTestWithAssistant, MetalayerToolViewCreated) {
TEST_F(PaletteTrayTestWithAssistant, MetalayerToolActivatesHighlighter) { TEST_F(PaletteTrayTestWithAssistant, MetalayerToolActivatesHighlighter) {
ui::ScopedAnimationDurationScaleMode animation_duration_mode( ui::ScopedAnimationDurationScaleMode animation_duration_mode(
ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION); ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION);
assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE);
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true);
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled, prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled,
true); true);
...@@ -453,7 +453,7 @@ TEST_F(PaletteTrayTestWithAssistant, StylusBarrelButtonActivatesHighlighter) { ...@@ -453,7 +453,7 @@ TEST_F(PaletteTrayTestWithAssistant, StylusBarrelButtonActivatesHighlighter) {
false /* no highlighter on press */); false /* no highlighter on press */);
// Once the service is ready, the button should start working. // Once the service is ready, the button should start working.
assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE);
// Press and drag with no button, still no highlighter. // Press and drag with no button, still no highlighter.
WaitDragAndAssertMetalayer("all enabled, no button ", origin, ui::EF_NONE, WaitDragAndAssertMetalayer("all enabled, no button ", origin, ui::EF_NONE,
......
...@@ -71,7 +71,8 @@ class MetalayerToolTest : public AshTestBase { ...@@ -71,7 +71,8 @@ class MetalayerToolTest : public AshTestBase {
// has enabled the metalayer AND the Assistant framework is ready. // has enabled the metalayer AND the Assistant framework is ready.
TEST_F(MetalayerToolTest, PaletteMenuState) { TEST_F(MetalayerToolTest, PaletteMenuState) {
const mojom::AssistantState kStates[] = {mojom::AssistantState::NOT_READY, const mojom::AssistantState kStates[] = {mojom::AssistantState::NOT_READY,
mojom::AssistantState::READY}; mojom::AssistantState::READY,
mojom::AssistantState::VISIBLE};
const mojom::AssistantAllowedState kAllowedStates[] = { const mojom::AssistantAllowedState kAllowedStates[] = {
mojom::AssistantAllowedState::ALLOWED, mojom::AssistantAllowedState::ALLOWED,
mojom::AssistantAllowedState::DISALLOWED_BY_POLICY, mojom::AssistantAllowedState::DISALLOWED_BY_POLICY,
...@@ -143,6 +144,7 @@ TEST_F(MetalayerToolTest, EnablingDisablingMetalayerEnablesDisablesController) { ...@@ -143,6 +144,7 @@ TEST_F(MetalayerToolTest, EnablingDisablingMetalayerEnablesDisablesController) {
// Verifies that disabling the metalayer support disables the tool. // Verifies that disabling the metalayer support disables the tool.
TEST_F(MetalayerToolTest, MetalayerUnsupportedDisablesPaletteTool) { TEST_F(MetalayerToolTest, MetalayerUnsupportedDisablesPaletteTool) {
assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE);
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true); prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantEnabled, true);
prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled, prefs()->SetBoolean(chromeos::assistant::prefs::kAssistantContextEnabled,
true); true);
...@@ -173,6 +175,7 @@ TEST_F(MetalayerToolTest, MetalayerUnsupportedDisablesPaletteTool) { ...@@ -173,6 +175,7 @@ TEST_F(MetalayerToolTest, MetalayerUnsupportedDisablesPaletteTool) {
DisableTool(PaletteToolId::METALAYER)) DisableTool(PaletteToolId::METALAYER))
.Times(0); .Times(0);
assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY); assistant_state()->NotifyStatusChanged(mojom::AssistantState::READY);
assistant_state()->NotifyStatusChanged(mojom::AssistantState::VISIBLE);
testing::Mock::VerifyAndClearExpectations(palette_tool_delegate_.get()); testing::Mock::VerifyAndClearExpectations(palette_tool_delegate_.get());
// Changing the state to NOT_READY should disable the tool. // Changing the state to NOT_READY should disable the tool.
......
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