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

Unified Diff: components/mus/public/cpp/lib/window.cc

Issue 1484533002: mus: Introduce AttachSurface to allow creating Surface prior to OnEmbed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Sadrul's comments Created 5 years, 1 month 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
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/public/cpp/lib/window.cc
diff --git a/components/mus/public/cpp/lib/window.cc b/components/mus/public/cpp/lib/window.cc
index 5da0a477d9a6855875f99dc7bef57fbf47874fcc..5284785a1120dcba031bf7d08810f5bb3b547cd5 100644
--- a/components/mus/public/cpp/lib/window.cc
+++ b/components/mus/public/cpp/lib/window.cc
@@ -217,13 +217,17 @@ bool Window::IsDrawn() const {
}
scoped_ptr<WindowSurface> Window::RequestSurface(mojom::SurfaceType type) {
- mojom::SurfacePtr surface;
- mojom::SurfaceClientPtr client;
- mojo::InterfaceRequest<mojom::SurfaceClient> client_request =
- GetProxy(&client);
- tree_client()->RequestSurface(id_, type, GetProxy(&surface), client.Pass());
- return make_scoped_ptr(
- new WindowSurface(surface.PassInterface(), client_request.Pass()));
+ scoped_ptr<WindowSurfaceBinding> surface_binding;
+ scoped_ptr<WindowSurface> surface = WindowSurface::Create(&surface_binding);
+ AttachSurface(type, surface_binding.Pass());
+ return surface;
+}
+
+void Window::AttachSurface(mojom::SurfaceType type,
+ scoped_ptr<WindowSurfaceBinding> surface_binding) {
+ tree_client()->AttachSurface(id_, type,
+ surface_binding->surface_request_.Pass(),
+ surface_binding->surface_client_.Pass());
}
void Window::ClearSharedProperty(const std::string& name) {
« no previous file with comments | « no previous file | components/mus/public/cpp/lib/window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698