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

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

Issue 1949233002: Create a RegisterViewAssociate method in ViewManager (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add tests to mojo tests Created 4 years, 7 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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h"
9 #include "services/ui/view_manager/view_impl.h" 10 #include "services/ui/view_manager/view_impl.h"
10 #include "services/ui/view_manager/view_tree_impl.h" 11 #include "services/ui/view_manager/view_tree_impl.h"
11 12
12 namespace view_manager { 13 namespace view_manager {
13 14
14 ViewManagerImpl::ViewManagerImpl(ViewRegistry* registry) 15 ViewManagerImpl::ViewManagerImpl(ViewRegistry* registry)
15 : registry_(registry) {} 16 : registry_(registry) {}
16 17
17 ViewManagerImpl::~ViewManagerImpl() {} 18 ViewManagerImpl::~ViewManagerImpl() {}
18 19
(...skipping 10 matching lines...) Expand all
29 void ViewManagerImpl::CreateViewTree( 30 void ViewManagerImpl::CreateViewTree(
30 mojo::InterfaceRequest<mojo::ui::ViewTree> view_tree_request, 31 mojo::InterfaceRequest<mojo::ui::ViewTree> view_tree_request,
31 mojo::InterfaceHandle<mojo::ui::ViewTreeListener> view_tree_listener, 32 mojo::InterfaceHandle<mojo::ui::ViewTreeListener> view_tree_listener,
32 const mojo::String& label) { 33 const mojo::String& label) {
33 registry_->CreateViewTree( 34 registry_->CreateViewTree(
34 view_tree_request.Pass(), 35 view_tree_request.Pass(),
35 mojo::ui::ViewTreeListenerPtr::Create(std::move(view_tree_listener)), 36 mojo::ui::ViewTreeListenerPtr::Create(std::move(view_tree_listener)),
36 label); 37 label);
37 } 38 }
38 39
40 // TODO(mikejurka): This should only be called by trusted code (ie launcher),
41 // once we have a security story.
42 void ViewManagerImpl::RegisterViewAssociate(
43 mojo::InterfaceHandle<mojo::ui::ViewAssociate> view_associate,
44 mojo::InterfaceRequest<mojo::ui::ViewAssociateOwner> view_associate_owner,
45 const mojo::String& label) {
46 registry_->RegisterViewAssociate(
47 registry_, mojo::ui::ViewAssociatePtr::Create(std::move(view_associate)),
48 view_associate_owner.Pass(), label);
49 }
50
51 void ViewManagerImpl::FinishedRegisteringViewAssociates() {
52 registry_->FinishedRegisteringViewAssociates();
53 }
54
39 } // namespace view_manager 55 } // 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