mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
blink::EventHandler is really hairy and deals with a lot of complex cases that don't matter for Sky. This CL starts a NewEventHandler and adds support for PointerEvents there. The NewEventHandler will eventually replace EventHandler once we've actually migrated over from Mouse+Touch events to PointerEvents. R=esprehn@chromium.org, ojan@chromium.org, eseidel@chromium.org Review URL: https://codereview.chromium.org/823873004
48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
// Copyright 2015 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_
|
|
#define SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_
|
|
|
|
#include "sky/engine/core/dom/Node.h"
|
|
#include "sky/engine/core/rendering/HitTestRequest.h"
|
|
#include "sky/engine/core/rendering/HitTestResult.h"
|
|
#include "sky/engine/wtf/HashMap.h"
|
|
|
|
namespace blink {
|
|
|
|
class LocalFrame;
|
|
class WebPointerEvent;
|
|
|
|
class NewEventHandler {
|
|
WTF_MAKE_NONCOPYABLE(NewEventHandler);
|
|
public:
|
|
explicit NewEventHandler(LocalFrame&);
|
|
~NewEventHandler();
|
|
|
|
bool handlePointerEvent(const WebPointerEvent&);
|
|
|
|
private:
|
|
bool handlePointerDownEvent(const WebPointerEvent&);
|
|
bool handlePointerUpEvent(const WebPointerEvent&);
|
|
bool handlePointerMoveEvent(const WebPointerEvent&);
|
|
bool handlePointerCancelEvent(const WebPointerEvent&);
|
|
|
|
bool dispatchPointerEvent(Node& target, const WebPointerEvent&);
|
|
bool dispatchClickEvent(Node& capturingTarget, const WebPointerEvent&);
|
|
|
|
Node* targetForHitTestResult(const HitTestResult& hitTestResult);
|
|
HitTestResult performHitTest(const LayoutPoint&);
|
|
void updateSelectionForPointerDown(const HitTestResult&, const WebPointerEvent&);
|
|
|
|
typedef HashMap<int, RefPtr<Node>> PointerTargetMap;
|
|
|
|
LocalFrame& m_frame;
|
|
PointerTargetMap m_targetForPointer;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // SKY_ENGINE_CORE_FRAME_NEWEVENTHANDLER_H_
|