#include "chrome/browser/ui/views/toolbar/toolbar_action_hover_card_controller.h"
#include "base/callback_list.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "chrome/browser/ui/toolbar/toolbar_action_hover_card_types.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "chrome/browser/ui/views/extensions/extensions_toolbar_container.h"
#include "chrome/browser/ui/views/toolbar/toolbar_action_hover_card_bubble_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_action_view.h"
#include "content/public/browser/web_contents.h"
#include "extensions/common/extension_features.h"
#include "ui/events/event_observer.h"
#include "ui/views/event_monitor.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
namespace {
constexpr base::TimeDelta kTriggerDelay = …;
constexpr base::TimeDelta kHoverCardSlideDuration = …;
}
bool ToolbarActionHoverCardController::disable_animations_for_testing_ = …;
class ToolbarActionHoverCardController::EventSniffer
: public ui::EventObserver { … };
ToolbarActionHoverCardController::ToolbarActionHoverCardController(
ExtensionsToolbarContainer* extensions_container)
: … { … }
ToolbarActionHoverCardController::~ToolbarActionHoverCardController() = default;
bool ToolbarActionHoverCardController::UseAnimations() { … }
bool ToolbarActionHoverCardController::IsHoverCardVisible() const { … }
bool ToolbarActionHoverCardController::IsHoverCardShowingForAction(
ToolbarActionView* action_view) const { … }
void ToolbarActionHoverCardController::UpdateHoverCard(
ToolbarActionView* action_view,
ToolbarActionHoverCardUpdateType update_type) { … }
void ToolbarActionHoverCardController::UpdateOrShowHoverCard(
ToolbarActionView* action_view,
ToolbarActionHoverCardUpdateType update_type) { … }
void ToolbarActionHoverCardController::UpdateHoverCardContent(
ToolbarActionView* action_view) { … }
void ToolbarActionHoverCardController::CreateHoverCard(
ToolbarActionView* action_view) { … }
void ToolbarActionHoverCardController::ShowHoverCard(
bool is_initial,
const ToolbarActionView* intended_action_view) { … }
void ToolbarActionHoverCardController::HideHoverCard() { … }
bool ToolbarActionHoverCardController::ShouldShowImmediately(
const ToolbarActionView* action_view) const { … }
const views::View* ToolbarActionHoverCardController::GetTargetAnchorView()
const { … }
bool ToolbarActionHoverCardController::TargetActionViewIsValid() const { … }
void ToolbarActionHoverCardController::OnFadeAnimationEnded(
views::WidgetFadeAnimator* animator,
views::WidgetFadeAnimator::FadeType fade_type) { … }
void ToolbarActionHoverCardController::OnSlideAnimationProgressed(
views::BubbleSlideAnimator* animator,
double value) { … }
void ToolbarActionHoverCardController::OnSlideAnimationComplete(
views::BubbleSlideAnimator* animator) { … }
void ToolbarActionHoverCardController::OnViewIsDeleting(
views::View* observed_view) { … }
void ToolbarActionHoverCardController::OnViewVisibilityChanged(
views::View* observed_view,
views::View* starting_view) { … }