mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 840721 - Add a PostDelayedTask method to the GeckoContentController interface. r=cjones
This commit is contained in:
parent
378d71c084
commit
dfdd0b2b64
@ -1489,6 +1489,14 @@ void AsyncPanZoomController::UpdateZoomConstraints(bool aAllowZoom,
|
||||
mMaxZoom = aMaxZoom;
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::PostDelayedTask(Task* aTask, int aDelayMs) {
|
||||
if (!mGeckoContentController) {
|
||||
return;
|
||||
}
|
||||
|
||||
mGeckoContentController->PostDelayedTask(aTask, aDelayMs);
|
||||
}
|
||||
|
||||
void AsyncPanZoomController::SendAsyncScrollEvent() {
|
||||
if (!mGeckoContentController) {
|
||||
return;
|
||||
|
@ -151,6 +151,12 @@ public:
|
||||
*/
|
||||
void UpdateZoomConstraints(bool aAllowZoom, float aMinScale, float aMaxScale);
|
||||
|
||||
/**
|
||||
* Schedules a runnable to run on the controller/UI thread at some time
|
||||
* in the future.
|
||||
*/
|
||||
void PostDelayedTask(Task* aTask, int aDelayMs);
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// These methods must only be called on the compositor thread.
|
||||
//
|
||||
|
@ -10,6 +10,8 @@
|
||||
#include "FrameMetrics.h"
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
class Task;
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
@ -52,6 +54,12 @@ public:
|
||||
virtual void SendAsyncScrollDOMEvent(const gfx::Rect &aContentRect,
|
||||
const gfx::Size &aScrollableSize) = 0;
|
||||
|
||||
/**
|
||||
* Schedules a runnable to run on the controller/UI thread at some time
|
||||
* in the future.
|
||||
*/
|
||||
virtual void PostDelayedTask(Task* aTask, int aDelayMs) = 0;
|
||||
|
||||
GeckoContentController() {}
|
||||
virtual ~GeckoContentController() {}
|
||||
};
|
||||
|
@ -88,8 +88,7 @@ nsEventStatus GestureEventListener::HandleInputEvent(const InputData& aEvent)
|
||||
mLongTapTimeoutTask =
|
||||
NewRunnableMethod(this, &GestureEventListener::TimeoutLongTap);
|
||||
|
||||
MessageLoop::current()->PostDelayedTask(
|
||||
FROM_HERE,
|
||||
mAsyncPanZoomController->PostDelayedTask(
|
||||
mLongTapTimeoutTask,
|
||||
Preferences::GetInt("ui.click_hold_context_menus.delay", 500));
|
||||
}
|
||||
@ -169,8 +168,7 @@ nsEventStatus GestureEventListener::HandleInputEvent(const InputData& aEvent)
|
||||
mDoubleTapTimeoutTask =
|
||||
NewRunnableMethod(this, &GestureEventListener::TimeoutDoubleTap);
|
||||
|
||||
MessageLoop::current()->PostDelayedTask(
|
||||
FROM_HERE,
|
||||
mAsyncPanZoomController->PostDelayedTask(
|
||||
mDoubleTapTimeoutTask,
|
||||
MAX_TAP_TIME);
|
||||
}
|
||||
|
@ -1,4 +1,7 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set sw=4 ts=8 et tw=80 : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set sw=4 ts=8 et tw=80 : */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef mozilla_layers_GestureEventListener_h
|
||||
|
@ -569,6 +569,11 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE
|
||||
{
|
||||
MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
|
||||
}
|
||||
|
||||
private:
|
||||
void DoRequestContentRepaint(const FrameMetrics& aFrameMetrics)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user