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

Side by Side Diff: components/mus/public/cpp/lib/window_tree_client_impl.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 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/mus/common/util.h" 8 #include "components/mus/common/util.h"
9 #include "components/mus/public/cpp/lib/in_flight_change.h" 9 #include "components/mus/public/cpp/lib/in_flight_change.h"
10 #include "components/mus/public/cpp/lib/window_private.h" 10 #include "components/mus/public/cpp/lib/window_private.h"
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 256
257 void WindowTreeClientImpl::Embed( 257 void WindowTreeClientImpl::Embed(
258 Id window_id, 258 Id window_id,
259 mojom::WindowTreeClientPtr client, 259 mojom::WindowTreeClientPtr client,
260 uint32_t policy_bitmask, 260 uint32_t policy_bitmask,
261 const mojom::WindowTree::EmbedCallback& callback) { 261 const mojom::WindowTree::EmbedCallback& callback) {
262 DCHECK(tree_); 262 DCHECK(tree_);
263 tree_->Embed(window_id, client.Pass(), policy_bitmask, callback); 263 tree_->Embed(window_id, client.Pass(), policy_bitmask, callback);
264 } 264 }
265 265
266 void WindowTreeClientImpl::RequestSurface( 266 void WindowTreeClientImpl::AttachSurface(
267 Id window_id, 267 Id window_id,
268 mojom::SurfaceType type, 268 mojom::SurfaceType type,
269 mojo::InterfaceRequest<mojom::Surface> surface, 269 mojo::InterfaceRequest<mojom::Surface> surface,
270 mojom::SurfaceClientPtr client) { 270 mojom::SurfaceClientPtr client) {
271 DCHECK(tree_); 271 DCHECK(tree_);
272 tree_->RequestSurface(window_id, type, surface.Pass(), client.Pass()); 272 tree_->AttachSurface(window_id, type, surface.Pass(), client.Pass());
273 } 273 }
274 274
275 void WindowTreeClientImpl::AddWindow(Window* window) { 275 void WindowTreeClientImpl::AddWindow(Window* window) {
276 DCHECK(windows_.find(window->id()) == windows_.end()); 276 DCHECK(windows_.find(window->id()) == windows_.end());
277 windows_[window->id()] = window; 277 windows_[window->id()] = window;
278 } 278 }
279 279
280 void WindowTreeClientImpl::RemoveWindow(Id window_id) { 280 void WindowTreeClientImpl::RemoveWindow(Id window_id) {
281 if (focused_window_ && focused_window_->id() == window_id) 281 if (focused_window_ && focused_window_->id() == window_id)
282 OnWindowFocused(0); 282 OnWindowFocused(0);
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 void WindowTreeClientImpl::OnActionCompleted(bool success) { 657 void WindowTreeClientImpl::OnActionCompleted(bool success) {
658 if (!change_acked_callback_.is_null()) 658 if (!change_acked_callback_.is_null())
659 change_acked_callback_.Run(); 659 change_acked_callback_.Run();
660 } 660 }
661 661
662 mojo::Callback<void(bool)> WindowTreeClientImpl::ActionCompletedCallback() { 662 mojo::Callback<void(bool)> WindowTreeClientImpl::ActionCompletedCallback() {
663 return [this](bool success) { OnActionCompleted(success); }; 663 return [this](bool success) { OnActionCompleted(success); };
664 } 664 }
665 665
666 } // namespace mus 666 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.h ('k') | components/mus/public/cpp/tests/test_window_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698