Skip to content

Commit

Permalink
Add missing implementations to the EmbedContentController
Browse files Browse the repository at this point in the history
New pure virtual method were introduced to GeckoContentController and
some old were changed.
  • Loading branch information
rainemak committed Dec 19, 2016
1 parent 42c8b4c commit e59245e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
18 changes: 3 additions & 15 deletions embedding/embedlite/EmbedLiteContentController.h
Expand Up @@ -42,7 +42,7 @@ class EmbedLiteContentController
* to.
*/
virtual void HandleDoubleTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) = 0;

/**
Expand All @@ -51,30 +51,18 @@ class EmbedLiteContentController
* button down, then mouse button up at |aPoint|.
*/
virtual void HandleSingleTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) = 0;

/**
* Requests handling a long tap. |aPoint| is in CSS pixels, relative to the
* current scroll offset.
*/
virtual void HandleLongTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) = 0;

/**
* Requests handling of releasing a long tap. |aPoint| is in CSS pixels,
* relative to the current scroll offset. HandleLongTapUp will always be
* preceeded by HandleLongTap. However not all calls to HandleLongTap will
* be followed by a HandleLongTapUp (for example, if the user drags
* around between the long-tap and lifting their finger, or if content
* notifies the APZ that the long-tap event was prevent-defaulted).
*/
virtual void HandleLongTapUp(const CSSPoint& aPoint,
int32_t aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) = 0;

/**
* Requests sending a mozbrowserasyncscroll domevent to embedder.
* |aContentRect| is in CSS pixels, relative to the current cssPage.
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/PEmbedLiteView.ipdl
Expand Up @@ -44,8 +44,8 @@ child:
AsyncScrollDOMEvent(gfxRect contentRect, gfxSize scrollSize);

UpdateFrame(FrameMetrics frame) compress;
HandleDoubleTap(CSSPoint aPoint, int32_t aModifiers, ScrollableLayerGuid aGuid);
HandleSingleTap(CSSPoint aPoint, int32_t aModifiers, ScrollableLayerGuid aGuid);
HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleLongTap(CSSPoint aPoint, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
HandleTextEvent(nsString commit, nsString preEdit);
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseChild.cpp
Expand Up @@ -797,7 +797,7 @@ EmbedLiteViewBaseChild::InitEvent(WidgetGUIEvent& event, nsIntPoint* aPoint)

bool
EmbedLiteViewBaseChild::RecvHandleDoubleTap(const CSSPoint& aPoint,
const int32_t& aModifiers,
const Modifiers &aModifiers,
const ScrollableLayerGuid& aGuid)
{
CSSPoint cssPoint = APZCCallbackHelper::ApplyCallbackTransform(
Expand All @@ -818,7 +818,7 @@ EmbedLiteViewBaseChild::RecvHandleDoubleTap(const CSSPoint& aPoint,

bool
EmbedLiteViewBaseChild::RecvHandleSingleTap(const CSSPoint& aPoint,
const int32_t& aModifiers,
const Modifiers &aModifiers,
const ScrollableLayerGuid& aGuid)
{
if (mIMEComposing) {
Expand Down
6 changes: 4 additions & 2 deletions embedding/embedlite/embedshared/EmbedLiteViewBaseChild.h
Expand Up @@ -7,6 +7,7 @@
#define MOZ_VIEW_EMBED_BASE_CHILD_H

#include "mozilla/embedlite/PEmbedLiteViewChild.h"
#include "mozilla/EventForwards.h" // for Modifiers

#include "nsIWebBrowser.h"
#include "nsIWidget.h"
Expand All @@ -17,6 +18,7 @@
#include "EmbedLiteViewChildIface.h"
#include "EmbedLitePuppetWidget.h"


namespace mozilla {
namespace embedlite {

Expand Down Expand Up @@ -133,9 +135,9 @@ class EmbedLiteViewBaseChild : public PEmbedLiteViewChild,
const gfxSize& scrollSize) override;

virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) override;
virtual bool RecvHandleDoubleTap(const CSSPoint&, const int32_t& aModifiers,
virtual bool RecvHandleDoubleTap(const CSSPoint&, const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid) override;
virtual bool RecvHandleSingleTap(const CSSPoint&, const int32_t& aModifiers,
virtual bool RecvHandleSingleTap(const CSSPoint&, const Modifiers& aModifiers,
const ScrollableLayerGuid& aGuid) override;
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
const mozilla::layers::ScrollableLayerGuid& aGuid,
Expand Down
24 changes: 14 additions & 10 deletions embedding/embedlite/embedthread/EmbedContentController.cpp
Expand Up @@ -38,11 +38,16 @@ void EmbedContentController::RequestContentRepaint(const FrameMetrics& aFrameMet
LOGT();
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &EmbedContentController::DoRequestContentRepaint, aFrameMetrics));
NewRunnableMethod(this, &EmbedContentController::DoRequestContentRepaint, aFrameMetrics));
}

void EmbedContentController::RequestFlingSnap(const FrameMetrics::ViewID &aScrollId, const mozilla::CSSPoint &aDestination)
{
LOGT();
}

void EmbedContentController::HandleDoubleTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid)
{
if (MessageLoop::current() != mUILoop) {
Expand All @@ -59,7 +64,7 @@ void EmbedContentController::HandleDoubleTap(const CSSPoint& aPoint,
}

void EmbedContentController::HandleSingleTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid)
{
if (MessageLoop::current() != mUILoop) {
Expand All @@ -76,7 +81,7 @@ void EmbedContentController::HandleSingleTap(const CSSPoint& aPoint,
}

void EmbedContentController::HandleLongTap(const CSSPoint& aPoint,
int32_t aModifiers,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId)
{
Expand All @@ -93,12 +98,6 @@ void EmbedContentController::HandleLongTap(const CSSPoint& aPoint,
}
}

void EmbedContentController::HandleLongTapUp(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid)
{
}

/**
* Requests sending a mozbrowserasyncscroll domevent to embedder.
* |aContentRect| is in CSS pixels, relative to the current cssPage.
Expand Down Expand Up @@ -205,6 +204,11 @@ EmbedContentController::ReceiveInputEvent(InputData& aEvent,
return mAPZC->ReceiveInputEvent(aEvent, aOutTargetGuid, aOutInputBlockId);
}

void EmbedContentController::NotifyFlushComplete()
{
printf("==================== notify flush complete\n");
}

void
EmbedContentController::SaveZoomConstraints(const ZoomConstraints& aConstraints)
{
Expand Down
13 changes: 8 additions & 5 deletions embedding/embedlite/embedthread/EmbedContentController.h
Expand Up @@ -32,13 +32,15 @@ class EmbedContentController : public mozilla::layers::GeckoContentController

// GeckoContentController interface
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) override;
virtual void HandleDoubleTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) override;
virtual void HandleSingleTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) override;
virtual void HandleLongTap(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override;
virtual void HandleLongTapUp(const CSSPoint& aPoint, int32_t aModifiers, const ScrollableLayerGuid& aGuid) override;
virtual void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
const mozilla::CSSPoint& aDestination) override;

virtual void HandleDoubleTap(const CSSPoint& aPoint, Modifiers aModifiers, const ScrollableLayerGuid& aGuid) override;
virtual void HandleSingleTap(const CSSPoint& aPoint, Modifiers aModifiers, const ScrollableLayerGuid& aGuid) override;
virtual void HandleLongTap(const CSSPoint& aPoint, Modifiers aModifiers, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override;
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
const CSSRect& aContentRect,
const CSSSize& aScrollableSize) override;
const CSSSize& aScrollableSize);
virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID&, const uint32_t&) override;
void ClearRenderFrame();
virtual void PostDelayedTask(Task* aTask, int aDelayMs) override;
Expand All @@ -47,6 +49,7 @@ class EmbedContentController : public mozilla::layers::GeckoContentController
nsEventStatus ReceiveInputEvent(InputData& aEvent,
mozilla::layers::ScrollableLayerGuid* aOutTargetGuid,
uint64_t* aInputBlockId);
virtual void NotifyFlushComplete() override;

mozilla::layers::APZCTreeManager* GetManager() { return mAPZC; }

Expand Down

0 comments on commit e59245e

Please sign in to comment.