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

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

Issue 1415493003: mozart: Initial commit of the view manager. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/bind.h"
6 #include "base/bind_helpers.h"
7 #include "services/ui/view_manager/view_tree_host_impl.h"
8
9 namespace view_manager {
10
11 ViewTreeHostImpl::ViewTreeHostImpl(
12 ViewRegistry* registry,
13 ViewTreeState* state,
14 mojo::InterfaceRequest<mojo::ui::ViewTreeHost> view_tree_host_request)
15 : registry_(registry),
16 state_(state),
17 binding_(this, view_tree_host_request.Pass()) {}
18
19 ViewTreeHostImpl::~ViewTreeHostImpl() {}
20
21 void ViewTreeHostImpl::RequestLayout() {
22 registry_->RequestLayout(state_);
23 }
24
25 void ViewTreeHostImpl::SetRoot(uint32_t root_key,
26 mojo::ui::ViewTokenPtr root_view_token) {
27 registry_->SetRoot(state_, root_key, root_view_token.Pass());
28 }
29
30 void ViewTreeHostImpl::ResetRoot() {
31 registry_->ResetRoot(state_);
32 }
33
34 static void RunLayoutRootCallback(
35 const ViewTreeHostImpl::LayoutRootCallback& callback,
36 mojo::ui::ViewLayoutInfoPtr info) {
37 callback.Run(info.Pass());
38 }
39
40 void ViewTreeHostImpl::LayoutRoot(
41 mojo::ui::ViewLayoutParamsPtr root_layout_params,
42 const LayoutRootCallback& callback) {
43 registry_->LayoutRoot(state_, root_layout_params.Pass(),
44 base::Bind(&RunLayoutRootCallback, callback));
45 }
46
47 } // namespace view_manager
OLDNEW
« no previous file with comments | « services/ui/view_manager/view_tree_host_impl.h ('k') | services/ui/view_manager/view_tree_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698