Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: ui/aura/mus/client_surface_embedder.h

Issue 2580063002: Mustash: Ensure surfaces submitted to Mus by WM and embedders contain Surfaces with embeded content. (Closed)
Patch Set: Addressing feedback. Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/aura/mus/client_surface_embedder.h
diff --git a/ui/aura/mus/client_surface_embedder.h b/ui/aura/mus/client_surface_embedder.h
new file mode 100644
index 0000000000000000000000000000000000000000..6d7c31fee4f547e657dbcd671783e322e7f1cc91
--- /dev/null
+++ b/ui/aura/mus/client_surface_embedder.h
@@ -0,0 +1,42 @@
+// 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"
+
+namespace ui {
+class Layer;
+}
+
+namespace aura {
+
+struct SurfaceInfo;
+class Window;
+
+// Used by WindowPortMus when it is embedding a client. Responsible for setting
+// up layers containing content from the client, parenting them to the window's
+// layer, and updating them when the client submits new surfaces.
+class ClientSurfaceEmbedder {
+ public:
+ explicit ClientSurfaceEmbedder(Window* window);
+ ~ClientSurfaceEmbedder();
+
+ // Updates the surface layer and the clip layer based on the surface info.
+ void UpdateSurface(const SurfaceInfo& surface_info);
+
+ private:
+ // The window which embeds the client.
+ Window* window_;
+
+ // Contains the client's content.
+ std::unique_ptr<ui::Layer> surface_layer_;
+
+ // Used for clipping the surface layer to the window bounds.
+ std::unique_ptr<ui::Layer> clip_layer_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClientSurfaceEmbedder);
+};
+
+} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698