#ifndef ASH_SHELF_HOME_BUTTON_CONTROLLER_H_
#define ASH_SHELF_HOME_BUTTON_CONTROLLER_H_
#include <memory>
#include "ash/assistant/model/assistant_ui_model_observer.h"
#include "ash/public/cpp/app_list/app_list_controller_observer.h"
#include "ash/public/cpp/assistant/assistant_state.h"
#include "ash/public/cpp/tablet_mode_observer.h"
#include "base/memory/raw_ptr.h"
namespace ui {
class GestureEvent;
}
namespace ash {
class AssistantOverlay;
class HomeButton;
class HomeButtonController : public AppListControllerObserver,
public TabletModeObserver,
public AssistantStateObserver,
public AssistantUiModelObserver {
public:
explicit HomeButtonController(HomeButton* button);
HomeButtonController(const HomeButtonController&) = delete;
HomeButtonController& operator=(const HomeButtonController&) = delete;
~HomeButtonController() override;
bool MaybeHandleGestureEvent(ui::GestureEvent* event);
bool IsAssistantAvailable();
bool IsAssistantVisible();
private:
void OnAppListVisibilityWillChange(bool shown, int64_t display_id) override;
void OnTabletModeStarted() override;
void OnAssistantFeatureAllowedChanged(
assistant::AssistantAllowedState) override;
void OnAssistantSettingsEnabled(bool enabled) override;
void OnUiVisibilityChanged(
AssistantVisibility new_visibility,
AssistantVisibility old_visibility,
absl::optional<AssistantEntryPoint> entry_point,
absl::optional<AssistantExitPoint> exit_point) override;
void OnAppListShown();
void OnAppListDismissed();
void StartAssistantAnimation();
void InitializeAssistantOverlay();
const raw_ptr<HomeButton, ExperimentalAsh> button_;
raw_ptr<AssistantOverlay, ExperimentalAsh> assistant_overlay_ = nullptr;
std::unique_ptr<base::OneShotTimer> assistant_animation_delay_timer_;
};
}
#endif