blob: e3a809d5e874e48484e59dc4a0c55fe1b70cfa9b [file] [log] [blame]
// Copyright 2017 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 <memory>
#include "base/macros.h"
#include "ui/aura/aura_export.h"
namespace ui {
class LayerOwner;
namespace viz {
class SurfaceId;
namespace aura {
class Window;
// Used to display content from another client. The other client is rendering
// to viz using the SurfaceId supplied to SetSurfaceId().
class AURA_EXPORT ClientSurfaceEmbedder {
explicit ClientSurfaceEmbedder(Window* window);
// Sets the current SurfaceId *and* updates the size of the layer to match
// that of the window.
void SetSurfaceId(const viz::SurfaceId& surface_id);
// Returns the SurfaceId, empty if SetSurfaceId() has not been called yet.
viz::SurfaceId GetSurfaceId() const;
// The window which embeds the client.
Window* window_;
// Contains the client's content. This (and other Layers) are wrapped in a
// LayerOwner so that animations clone the layer.
std::unique_ptr<ui::LayerOwner> surface_layer_owner_;
} // namespace aura