2013-09-16 14:45:31 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#include "ParentProcessController.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsLayoutUtils.h"
|
2014-04-17 04:54:25 -07:00
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
2013-09-16 14:45:31 -07:00
|
|
|
#include "base/message_loop.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace widget {
|
|
|
|
|
|
|
|
void
|
|
|
|
ParentProcessController::RequestContentRepaint(const FrameMetrics& aFrameMetrics)
|
|
|
|
{
|
2014-10-03 10:39:37 -07:00
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
|
2014-03-21 14:48:08 -07:00
|
|
|
if (aFrameMetrics.GetScrollId() == FrameMetrics::NULL_SCROLL_ID) {
|
2013-09-16 14:45:31 -07:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-10-03 10:39:37 -07:00
|
|
|
nsCOMPtr<nsIContent> content = nsLayoutUtils::FindContentFor(aFrameMetrics.GetScrollId());
|
|
|
|
if (content) {
|
|
|
|
FrameMetrics metrics = aFrameMetrics;
|
|
|
|
mozilla::layers::APZCCallbackHelper::UpdateSubFrame(content, metrics);
|
2013-09-16 14:45:31 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-05 14:43:20 -08:00
|
|
|
void
|
|
|
|
ParentProcessController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
|
|
|
|
const uint32_t& aScrollGeneration)
|
|
|
|
{
|
2014-04-17 04:54:25 -07:00
|
|
|
mozilla::layers::APZCCallbackHelper::AcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
|
2014-02-05 14:43:20 -08:00
|
|
|
}
|
|
|
|
|
2013-09-16 14:45:31 -07:00
|
|
|
void
|
|
|
|
ParentProcessController::PostDelayedTask(Task* aTask, int aDelayMs)
|
|
|
|
{
|
|
|
|
MessageLoop::current()->PostDelayedTask(FROM_HERE, aTask, aDelayMs);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|