#include "ui/aura/window_event_dispatcher.h"
#include <stddef.h>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "cc/metrics/custom_metrics_recorder.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/event_client.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/client/screen_position_client.h"
#include "ui/aura/env.h"
#include "ui/aura/env_input_state_controller.h"
#include "ui/aura/window_delegate.h"
#include "ui/aura/window_event_dispatcher_observer.h"
#include "ui/aura/window_targeter.h"
#include "ui/aura/window_tracker.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/hit_test.h"
#include "ui/base/ime/input_method.h"
#include "ui/compositor/compositor.h"
#include "ui/display/screen.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/gestures/gesture_recognizer.h"
#include "ui/events/gestures/gesture_types.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/geometry/transform.h"
DispatchDetails;
namespace aura {
namespace {
bool IsNonClientLocation(Window* target, const gfx::Point& location) { … }
Window* ConsumerToWindow(ui::GestureConsumer* consumer) { … }
bool IsEventCandidateForHold(const ui::Event& event) { … }
}
WindowEventDispatcher::ObserverNotifier::ObserverNotifier(
WindowEventDispatcher* dispatcher,
const ui::Event& event)
: … { … }
WindowEventDispatcher::ObserverNotifier::~ObserverNotifier() { … }
WindowEventDispatcher::WindowEventDispatcher(WindowTreeHost* host)
: … { … }
WindowEventDispatcher::~WindowEventDispatcher() { … }
void WindowEventDispatcher::Shutdown() { … }
ui::EventTargeter* WindowEventDispatcher::GetDefaultEventTargeter() { … }
void WindowEventDispatcher::RepostEvent(const ui::LocatedEvent* event) { … }
void WindowEventDispatcher::OnMouseEventsEnableStateChanged(bool enabled) { … }
void WindowEventDispatcher::DispatchCancelModeEvent() { … }
void WindowEventDispatcher::DispatchGestureEvent(
ui::GestureConsumer* raw_input_consumer,
ui::GestureEvent* event) { … }
DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint(
Window* window,
const gfx::Point& point,
int event_flags) { … }
void WindowEventDispatcher::ProcessedTouchEvent(
uint32_t unique_event_id,
Window* window,
ui::EventResult result,
bool is_source_touch_event_set_blocking) { … }
void WindowEventDispatcher::HoldPointerMoves() { … }
void WindowEventDispatcher::ReleasePointerMoves() { … }
gfx::Point WindowEventDispatcher::GetLastMouseLocationInRoot() const { … }
void WindowEventDispatcher::OnHostLostMouseGrab() { … }
void WindowEventDispatcher::OnCursorMovedToRootLocation(
const gfx::Point& root_location) { … }
void WindowEventDispatcher::OnPostNotifiedWindowDestroying(Window* window) { … }
Window* WindowEventDispatcher::window() { … }
const Window* WindowEventDispatcher::window() const { … }
void WindowEventDispatcher::ConvertPointFromScreen(gfx::Point* point) const { … }
void WindowEventDispatcher::TransformEventForDeviceScaleFactor(
ui::LocatedEvent* event) { … }
void WindowEventDispatcher::DispatchMouseExitToHidingWindow(Window* window) { … }
ui::EventDispatchDetails WindowEventDispatcher::DispatchMouseEnterOrExit(
Window* target,
const ui::MouseEvent& event,
ui::EventType type) { … }
ui::EventDispatchDetails WindowEventDispatcher::ProcessGestures(
Window* target,
ui::GestureRecognizer::Gestures gestures) { … }
void WindowEventDispatcher::OnWindowHidden(Window* invisible,
WindowHiddenReason reason) { … }
bool WindowEventDispatcher::is_dispatched_held_event(
const ui::Event& event) const { … }
void WindowEventDispatcher::UpdateCapture(Window* old_capture,
Window* new_capture) { … }
void WindowEventDispatcher::OnOtherRootGotCapture() { … }
void WindowEventDispatcher::SetNativeCapture() { … }
void WindowEventDispatcher::ReleaseNativeCapture() { … }
ui::EventTarget* WindowEventDispatcher::GetRootForEvent(ui::Event* event) { … }
void WindowEventDispatcher::OnEventProcessingStarted(ui::Event* event) { … }
void WindowEventDispatcher::OnEventProcessingFinished(ui::Event* event) { … }
bool WindowEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { … }
ui::EventDispatchDetails WindowEventDispatcher::PreDispatchEvent(
ui::EventTarget* target,
ui::Event* event) { … }
ui::EventDispatchDetails WindowEventDispatcher::PostDispatchEvent(
ui::EventTarget* target,
const ui::Event& event) { … }
bool WindowEventDispatcher::CanDispatchToConsumer(
ui::GestureConsumer* consumer) { … }
void WindowEventDispatcher::DispatchSyntheticTouchEvent(ui::TouchEvent* event) { … }
void WindowEventDispatcher::OnWindowDestroying(Window* window) { … }
void WindowEventDispatcher::OnWindowDestroyed(Window* window) { … }
void WindowEventDispatcher::OnWindowAddedToRootWindow(Window* attached) { … }
void WindowEventDispatcher::OnWindowRemovingFromRootWindow(Window* detached,
Window* new_root) { … }
void WindowEventDispatcher::OnWindowVisibilityChanging(Window* window,
bool visible) { … }
void WindowEventDispatcher::OnWindowVisibilityChanged(Window* window,
bool visible) { … }
void WindowEventDispatcher::OnWindowBoundsChanged(
Window* window,
const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds,
ui::PropertyChangeReason reason) { … }
void WindowEventDispatcher::OnWindowTargetTransformChanging(
Window* window,
const gfx::Transform& new_transform) { … }
void WindowEventDispatcher::OnWindowTransformed(
Window* window,
ui::PropertyChangeReason reason) { … }
void WindowEventDispatcher::OnWindowInitialized(Window* window) { … }
ui::EventDispatchDetails WindowEventDispatcher::DispatchHeldEvents() { … }
void WindowEventDispatcher::PostSynthesizeMouseMove(Window* window) { … }
void WindowEventDispatcher::SynthesizeMouseMoveAfterChangeToWindow(
Window* window) { … }
ui::EventDispatchDetails WindowEventDispatcher::SynthesizeMouseMoveEvent() { … }
DispatchDetails WindowEventDispatcher::PreDispatchLocatedEvent(
Window* target,
ui::LocatedEvent* event) { … }
DispatchDetails WindowEventDispatcher::PreDispatchMouseEvent(
Window* target,
ui::MouseEvent* event) { … }
DispatchDetails WindowEventDispatcher::PreDispatchPinchEvent(
Window* target,
ui::GestureEvent* event) { … }
DispatchDetails WindowEventDispatcher::PreDispatchTouchEvent(
Window* target,
ui::TouchEvent* event) { … }
DispatchDetails WindowEventDispatcher::PreDispatchKeyEvent(
Window* target,
ui::KeyEvent* event) { … }
std::unique_ptr<cc::EventsMetricsManager::ScopedMonitor>
WindowEventDispatcher::CreateScropedMetricsMonitorForEvent(
const ui::Event& event) { … }
}