blob: 9022083d35497a88e9e2817bdc6833d331c5416d [file] [log] [blame]
// Copyright 2016 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.
#include "android_webview/browser/child_frame.h"
#include "android_webview/browser/parent_compositor_draw_constraints.h"
#include "ui/gfx/geometry/vector2d.h"
namespace android_webview {
class ChildFrame;
class CompositorFrameProducer;
class CompositorFrameConsumer {
// A CompositorFrameConsumer may be registered with at most one
// CompositorFrameProducer.
// The producer is responsible for managing the relationship with its
// consumers. The only exception to this is when a consumer is explicitly
// destroyed, at which point it needs to inform its producer.
// In order to register a consumer with a new producer, the current producer
// must unregister the consumer, and call SetCompositorProducer(nullptr).
virtual void SetCompositorFrameProducer(
CompositorFrameProducer* compositor_frame_producer) = 0;
virtual void SetScrollOffsetOnUI(gfx::Vector2d scroll_offset) = 0;
// Returns uncommitted frame to be returned, if any.
virtual std::unique_ptr<ChildFrame> SetFrameOnUI(
std::unique_ptr<ChildFrame> frame) = 0;
virtual ParentCompositorDrawConstraints GetParentDrawConstraintsOnUI()
const = 0;
virtual ChildFrameQueue PassUncommittedFrameOnUI() = 0;
virtual ~CompositorFrameConsumer() {}
} // namespace android_webview