#include "content/browser/renderer_host/input/touch_selection_controller_client_aura.h"
#include <set>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/observer_list.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/render_view_host.h"
#include "third_party/blink/public/mojom/input/input_handler.mojom-shared.h"
#include "ui/aura/client/cursor_client.h"
#include "ui/aura/env.h"
#include "ui/aura/window.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/data_transfer_policy/data_transfer_endpoint.h"
#include "ui/base/pointer/touch_editing_controller.h"
#include "ui/base/ui_base_features.h"
#include "ui/events/event_observer.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/touch_selection/touch_handle_drawable_aura.h"
#include "ui/touch_selection/touch_selection_magnifier_aura.h"
#include "ui/touch_selection/touch_selection_menu_runner.h"
namespace content {
namespace {
constexpr int kQuickMenuDelayInMs = …;
}
class TouchSelectionControllerClientAura::EnvEventObserver
: public ui::EventObserver { … };
TouchSelectionControllerClientAura::TouchSelectionControllerClientAura(
RenderWidgetHostViewAura* rwhva)
: … { … }
TouchSelectionControllerClientAura::~TouchSelectionControllerClientAura() { … }
void TouchSelectionControllerClientAura::OnWindowMoved() { … }
void TouchSelectionControllerClientAura::OnTouchDown() { … }
void TouchSelectionControllerClientAura::OnTouchUp() { … }
void TouchSelectionControllerClientAura::OnScrollStarted() { … }
void TouchSelectionControllerClientAura::OnScrollCompleted() { … }
bool TouchSelectionControllerClientAura::HandleContextMenu(
const ContextMenuParams& params) { … }
void TouchSelectionControllerClientAura::DidStopFlinging() { … }
void TouchSelectionControllerClientAura::OnSwipeToMoveCursorBegin() { … }
void TouchSelectionControllerClientAura::OnSwipeToMoveCursorEnd() { … }
void TouchSelectionControllerClientAura::OnClientHitTestRegionUpdated(
ui::TouchSelectionControllerClient* client) { … }
void TouchSelectionControllerClientAura::UpdateClientSelectionBounds(
const gfx::SelectionBound& start,
const gfx::SelectionBound& end) { … }
void TouchSelectionControllerClientAura::UpdateClientSelectionBounds(
const gfx::SelectionBound& start,
const gfx::SelectionBound& end,
ui::TouchSelectionControllerClient* client,
ui::TouchSelectionMenuClient* menu_client) { … }
void TouchSelectionControllerClientAura::InvalidateClient(
ui::TouchSelectionControllerClient* client) { … }
ui::TouchSelectionController*
TouchSelectionControllerClientAura::GetTouchSelectionController() { … }
void TouchSelectionControllerClientAura::AddObserver(
TouchSelectionControllerClientManager::Observer* observer) { … }
void TouchSelectionControllerClientAura::RemoveObserver(
TouchSelectionControllerClientManager::Observer* observer) { … }
bool TouchSelectionControllerClientAura::IsQuickMenuAvailable() const { … }
void TouchSelectionControllerClientAura::ShowQuickMenu() { … }
void TouchSelectionControllerClientAura::UpdateQuickMenu() { … }
void TouchSelectionControllerClientAura::ShowMagnifier() { … }
void TouchSelectionControllerClientAura::HideMagnifier() { … }
bool TouchSelectionControllerClientAura::SupportsAnimation() const { … }
bool TouchSelectionControllerClientAura::InternalClient::SupportsAnimation()
const { … }
void TouchSelectionControllerClientAura::SetNeedsAnimate() { … }
void TouchSelectionControllerClientAura::InternalClient::SetNeedsAnimate() { … }
void TouchSelectionControllerClientAura::MoveCaret(
const gfx::PointF& position) { … }
void TouchSelectionControllerClientAura::InternalClient::MoveCaret(
const gfx::PointF& position) { … }
void TouchSelectionControllerClientAura::MoveRangeSelectionExtent(
const gfx::PointF& extent) { … }
void TouchSelectionControllerClientAura::InternalClient::
MoveRangeSelectionExtent(const gfx::PointF& extent) { … }
void TouchSelectionControllerClientAura::SelectBetweenCoordinates(
const gfx::PointF& base,
const gfx::PointF& extent) { … }
void TouchSelectionControllerClientAura::InternalClient::
SelectBetweenCoordinates(const gfx::PointF& base,
const gfx::PointF& extent) { … }
void TouchSelectionControllerClientAura::OnSelectionEvent(
ui::SelectionEventType event) { … }
void TouchSelectionControllerClientAura::InternalClient::OnSelectionEvent(
ui::SelectionEventType event) { … }
void TouchSelectionControllerClientAura::OnDragUpdate(
const ui::TouchSelectionDraggable::Type type,
const gfx::PointF& position) { … }
void TouchSelectionControllerClientAura::InternalClient::OnDragUpdate(
const ui::TouchSelectionDraggable::Type type,
const gfx::PointF& position) { … }
std::unique_ptr<ui::TouchHandleDrawable>
TouchSelectionControllerClientAura::CreateDrawable() { … }
void TouchSelectionControllerClientAura::DidScroll() { … }
std::unique_ptr<ui::TouchHandleDrawable>
TouchSelectionControllerClientAura::InternalClient::CreateDrawable() { … }
void TouchSelectionControllerClientAura::InternalClient::DidScroll() { … }
bool TouchSelectionControllerClientAura::IsCommandIdEnabled(
int command_id) const { … }
void TouchSelectionControllerClientAura::ExecuteCommand(int command_id,
int event_flags) { … }
void TouchSelectionControllerClientAura::RunContextMenu() { … }
bool TouchSelectionControllerClientAura::ShouldShowQuickMenu() { … }
std::u16string TouchSelectionControllerClientAura::GetSelectedText() { … }
}