#include "ui/views/corewm/tooltip_controller.h"
#include <stddef.h>
#include <string_view>
#include <utility>
#include <vector>
#include "base/time/time.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/client/drag_drop_client.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_type.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/ozone/public/ozone_platform.h"
#include "ui/views/corewm/tooltip_state_manager.h"
#include "ui/views/widget/tooltip_manager.h"
#include "ui/wm/public/activation_client.h"
#include "ui/wm/public/tooltip_observer.h"
namespace views::corewm {
namespace {
constexpr auto kDefaultShowTooltipDelay = …;
constexpr auto kDefaultHideTooltipDelay = …;
bool IsValidTarget(aura::Window* event_target, aura::Window* target) { … }
aura::Window* GetTooltipTarget(const ui::MouseEvent& event,
gfx::Point* location) { … }
}
TooltipController::TooltipController(std::unique_ptr<Tooltip> tooltip,
wm::ActivationClient* activation_client)
: … { … }
TooltipController::~TooltipController() { … }
void TooltipController::AddObserver(wm::TooltipObserver* observer) { … }
void TooltipController::RemoveObserver(wm::TooltipObserver* observer) { … }
int TooltipController::GetMaxWidth(const gfx::Point& location) const { … }
void TooltipController::UpdateTooltip(aura::Window* target) { … }
void TooltipController::UpdateTooltipFromKeyboard(const gfx::Rect& bounds,
aura::Window* target) { … }
void TooltipController::UpdateTooltipFromKeyboardWithAnchorPoint(
const gfx::Point& anchor_point,
aura::Window* target) { … }
bool TooltipController::IsTooltipSetFromKeyboard(aura::Window* target) { … }
void TooltipController::SetHideTooltipTimeout(aura::Window* target,
base::TimeDelta timeout) { … }
void TooltipController::SetTooltipsEnabled(bool enable) { … }
void TooltipController::OnKeyEvent(ui::KeyEvent* event) { … }
void TooltipController::OnMouseEvent(ui::MouseEvent* event) { … }
void TooltipController::OnTouchEvent(ui::TouchEvent* event) { … }
void TooltipController::OnCancelMode(ui::CancelModeEvent* event) { … }
std::string_view TooltipController::GetLogContext() const { … }
void TooltipController::OnCursorVisibilityChanged(bool is_visible) { … }
void TooltipController::OnWindowVisibilityChanged(aura::Window* window,
bool visible) { … }
void TooltipController::OnWindowDestroying(aura::Window* window) { … }
void TooltipController::OnWindowDestroyed(aura::Window* window) { … }
void TooltipController::OnWindowPropertyChanged(aura::Window* window,
const void* key,
intptr_t old) { … }
void TooltipController::OnWindowActivated(ActivationReason reason,
aura::Window* gained_active,
aura::Window* lost_active) { … }
void TooltipController::SetShowTooltipDelay(aura::Window* target,
base::TimeDelta delay) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
void TooltipController::OnTooltipShownOnServer(aura::Window* window,
const std::u16string& text,
const gfx::Rect& bounds) {
state_manager_->OnTooltipShownOnServer(window, text, bounds);
}
void TooltipController::OnTooltipHiddenOnServer() {
state_manager_->OnTooltipHiddenOnServer();
}
#endif
void TooltipController::HideAndReset() { … }
void TooltipController::UpdateIfRequired(TooltipTrigger trigger) { … }
bool TooltipController::IsDragDropInProgress() const { … }
bool TooltipController::IsCursorVisible() const { … }
base::TimeDelta TooltipController::GetShowTooltipDelay() { … }
base::TimeDelta TooltipController::GetHideTooltipDelay() { … }
void TooltipController::SetObservedWindow(aura::Window* target) { … }
bool TooltipController::IsTooltipIdUpdateNeeded() const { … }
bool TooltipController::IsTooltipTextUpdateNeeded() const { … }
void TooltipController::RemoveTooltipDelayFromMap(aura::Window* window) { … }
void TooltipController::ResetWindowAtMousePressedIfNeeded(aura::Window* target,
bool force_reset) { … }
bool TooltipController::ShouldHideBecauseMouseWasOncePressed() { … }
bool TooltipController::IsDuplicatePenHoverEvent(
ui::EventPointerType pointer_type) { … }
}