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

Side by Side Diff: services/ui/view_manager/view_manager_impl.cc

Issue 1679023006: Reify view ownership as a message pipe. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « services/ui/view_manager/view_manager_impl.h ('k') | services/ui/view_manager/view_registry.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/view_manager/view_manager_impl.h" 5 #include "services/ui/view_manager/view_manager_impl.h"
6 6
7 #include "services/ui/view_manager/view_host_impl.h" 7 #include "services/ui/view_manager/view_host_impl.h"
8 #include "services/ui/view_manager/view_tree_host_impl.h" 8 #include "services/ui/view_manager/view_tree_host_impl.h"
9 9
10 namespace view_manager { 10 namespace view_manager {
11 11
12 ViewManagerImpl::ViewManagerImpl(ViewRegistry* registry) 12 ViewManagerImpl::ViewManagerImpl(ViewRegistry* registry)
13 : registry_(registry) {} 13 : registry_(registry) {}
14 14
15 ViewManagerImpl::~ViewManagerImpl() {} 15 ViewManagerImpl::~ViewManagerImpl() {}
16 16
17 void ViewManagerImpl::RegisterView( 17 void ViewManagerImpl::RegisterView(
18 mojo::ui::ViewPtr view, 18 mojo::ui::ViewPtr view,
19 mojo::InterfaceRequest<mojo::ui::ViewHost> view_host_request, 19 mojo::InterfaceRequest<mojo::ui::ViewHost> view_host_request,
20 const mojo::String& label, 20 mojo::InterfaceRequest<mojo::ui::ViewOwner> view_owner_request,
21 const RegisterViewCallback& callback) { 21 const mojo::String& label) {
22 mojo::ui::ViewTokenPtr view_token = 22 registry_->RegisterView(view.Pass(), view_host_request.Pass(),
23 registry_->RegisterView(view.Pass(), view_host_request.Pass(), label); 23 view_owner_request.Pass(), label);
24 callback.Run(view_token.Pass());
25 } 24 }
26 25
27 void ViewManagerImpl::RegisterViewTree( 26 void ViewManagerImpl::RegisterViewTree(
28 mojo::ui::ViewTreePtr view_tree, 27 mojo::ui::ViewTreePtr view_tree,
29 mojo::InterfaceRequest<mojo::ui::ViewTreeHost> view_tree_host_request, 28 mojo::InterfaceRequest<mojo::ui::ViewTreeHost> view_tree_host_request,
30 const mojo::String& label, 29 const mojo::String& label) {
31 const RegisterViewTreeCallback& callback) { 30 registry_->RegisterViewTree(view_tree.Pass(), view_tree_host_request.Pass(),
32 mojo::ui::ViewTreeTokenPtr view_tree_token = registry_->RegisterViewTree( 31 label);
33 view_tree.Pass(), view_tree_host_request.Pass(), label);
34 callback.Run(view_tree_token.Pass());
35 } 32 }
36 33
37 } // namespace view_manager 34 } // namespace view_manager
OLDNEW
« no previous file with comments | « services/ui/view_manager/view_manager_impl.h ('k') | services/ui/view_manager/view_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698