#include "ui/touch_selection/touch_selection_controller.h"
#include <memory>
#include "base/auto_reset.h"
#include "base/check_op.h"
#include "base/metrics/user_metrics.h"
#include "base/notreached.h"
#include "ui/touch_selection/touch_selection_metrics.h"
namespace ui {
namespace {
gfx::Vector2dF ComputeLineOffsetFromBottom(const gfx::SelectionBound& bound) { … }
TouchHandleOrientation ToTouchHandleOrientation(
gfx::SelectionBound::Type type) { … }
}
TouchSelectionController::TouchSelectionController(
TouchSelectionControllerClient* client,
const Config& config)
: … { … }
TouchSelectionController::~TouchSelectionController() { … }
void TouchSelectionController::OnSelectionBoundsChanged(
const gfx::SelectionBound& start,
const gfx::SelectionBound& end) { … }
void TouchSelectionController::OnViewportChanged(
const gfx::RectF viewport_rect) { … }
bool TouchSelectionController::WillHandleTouchEvent(const MotionEvent& event) { … }
void TouchSelectionController::HandleTapEvent(const gfx::PointF& location,
int tap_count) { … }
void TouchSelectionController::HandleLongPressEvent(
base::TimeTicks event_time,
const gfx::PointF& location) { … }
void TouchSelectionController::HandleDoublePressEvent(
base::TimeTicks event_time,
const gfx::PointF& location) { … }
void TouchSelectionController::OnScrollBeginEvent() { … }
void TouchSelectionController::OnMenuCommand(bool should_dismiss_handles) { … }
void TouchSelectionController::OnSessionEndEvent(const Event& event) { … }
void TouchSelectionController::HideHandles() { … }
void TouchSelectionController::HideAndDisallowShowingAutomatically() { … }
void TouchSelectionController::SetTemporarilyHidden(bool hidden) { … }
bool TouchSelectionController::Animate(base::TimeTicks frame_time) { … }
const gfx::SelectionBound& TouchSelectionController::GetFocusBound() const { … }
gfx::RectF TouchSelectionController::GetRectBetweenBounds() const { … }
gfx::RectF TouchSelectionController::GetVisibleRectBetweenBounds() const { … }
gfx::RectF TouchSelectionController::GetStartHandleRect() const { … }
gfx::RectF TouchSelectionController::GetEndHandleRect() const { … }
float TouchSelectionController::GetTouchHandleHeight() const { … }
float TouchSelectionController::GetActiveHandleMiddleY() const { … }
const gfx::PointF& TouchSelectionController::GetStartPosition() const { … }
const gfx::PointF& TouchSelectionController::GetEndPosition() const { … }
bool TouchSelectionController::WillHandleTouchEventImpl(
const MotionEvent& event) { … }
void TouchSelectionController::OnSwipeToMoveCursorBegin() { … }
void TouchSelectionController::OnSwipeToMoveCursorEnd() { … }
void TouchSelectionController::OnDragBegin(
const TouchSelectionDraggable& draggable,
const gfx::PointF& drag_position) { … }
void TouchSelectionController::OnDragUpdate(
const TouchSelectionDraggable& draggable,
const gfx::PointF& drag_position) { … }
void TouchSelectionController::OnDragEnd(
const TouchSelectionDraggable& draggable) { … }
bool TouchSelectionController::IsWithinTapSlop(
const gfx::Vector2dF& delta) const { … }
void TouchSelectionController::OnHandleTapped(const TouchHandle& handle) { … }
void TouchSelectionController::SetNeedsAnimate() { … }
std::unique_ptr<TouchHandleDrawable>
TouchSelectionController::CreateDrawable() { … }
base::TimeDelta TouchSelectionController::GetMaxTapDuration() const { … }
bool TouchSelectionController::IsAdaptiveHandleOrientationEnabled() const { … }
void TouchSelectionController::OnLongPressDragActiveStateChanged() { … }
gfx::PointF TouchSelectionController::GetSelectionStart() const { … }
gfx::PointF TouchSelectionController::GetSelectionEnd() const { … }
void TouchSelectionController::OnInsertionChanged() { … }
void TouchSelectionController::OnSelectionChanged() { … }
bool TouchSelectionController::ActivateInsertionIfNecessary() { … }
void TouchSelectionController::DeactivateInsertion() { … }
bool TouchSelectionController::ActivateSelectionIfNecessary() { … }
void TouchSelectionController::DeactivateSelection() { … }
void TouchSelectionController::UpdateHandleLayoutIfNecessary() { … }
void TouchSelectionController::RefreshHandleVisibility() { … }
gfx::Vector2dF TouchSelectionController::GetStartLineOffset() const { … }
gfx::Vector2dF TouchSelectionController::GetEndLineOffset() const { … }
bool TouchSelectionController::GetStartVisible() const { … }
bool TouchSelectionController::GetEndVisible() const { … }
TouchHandle::AnimationStyle TouchSelectionController::GetAnimationStyle(
bool was_active) const { … }
void TouchSelectionController::LogDragType(
const TouchSelectionDraggable& draggable) { … }
}