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

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

Issue 1552043002: Make Mozart view manager use the new compositor. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-12
Patch Set: Created 4 years, 11 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
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_host_impl.h"
6
5 #include "base/bind.h" 7 #include "base/bind.h"
6 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
7 #include "services/ui/view_manager/view_host_impl.h"
8 9
9 namespace view_manager { 10 namespace view_manager {
10 11
11 ViewHostImpl::ViewHostImpl( 12 ViewHostImpl::ViewHostImpl(
12 ViewRegistry* registry, 13 ViewRegistry* registry,
13 ViewState* state, 14 ViewState* state,
14 mojo::InterfaceRequest<mojo::ui::ViewHost> view_host_request) 15 mojo::InterfaceRequest<mojo::ui::ViewHost> view_host_request)
15 : registry_(registry), 16 : registry_(registry),
16 state_(state), 17 state_(state),
17 binding_(this, view_host_request.Pass()) {} 18 binding_(this, view_host_request.Pass()) {}
18 19
19 ViewHostImpl::~ViewHostImpl() {} 20 ViewHostImpl::~ViewHostImpl() {}
20 21
21 void ViewHostImpl::GetServiceProvider( 22 void ViewHostImpl::GetServiceProvider(
22 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider) { 23 mojo::InterfaceRequest<mojo::ServiceProvider> service_provider_request) {
23 state_->GetServiceProvider(service_provider.Pass()); 24 service_provider_bindings_.AddBinding(this, service_provider_request.Pass());
25 }
26
27 void ViewHostImpl::CreateScene(
28 mojo::InterfaceRequest<mojo::gfx::composition::Scene> scene) {
29 registry_->CreateScene(state_, scene.Pass());
24 } 30 }
25 31
26 void ViewHostImpl::RequestLayout() { 32 void ViewHostImpl::RequestLayout() {
27 registry_->RequestLayout(state_); 33 registry_->RequestLayout(state_);
28 } 34 }
29 35
30 void ViewHostImpl::AddChild(uint32_t child_key, 36 void ViewHostImpl::AddChild(uint32_t child_key,
31 mojo::ui::ViewTokenPtr child_view_token) { 37 mojo::ui::ViewTokenPtr child_view_token) {
32 registry_->AddChild(state_, child_key, child_view_token.Pass()); 38 registry_->AddChild(state_, child_key, child_view_token.Pass());
33 } 39 }
34 40
35 void ViewHostImpl::RemoveChild(uint32_t child_key) { 41 void ViewHostImpl::RemoveChild(uint32_t child_key) {
36 registry_->RemoveChild(state_, child_key); 42 registry_->RemoveChild(state_, child_key);
37 } 43 }
38 44
39 static void RunLayoutChildCallback( 45 static void RunLayoutChildCallback(
40 const ViewHostImpl::LayoutChildCallback& callback, 46 const ViewHostImpl::LayoutChildCallback& callback,
41 mojo::ui::ViewLayoutInfoPtr info) { 47 mojo::ui::ViewLayoutInfoPtr info) {
42 callback.Run(info.Pass()); 48 callback.Run(info.Pass());
43 } 49 }
44 50
45 void ViewHostImpl::LayoutChild( 51 void ViewHostImpl::LayoutChild(
46 uint32_t child_key, 52 uint32_t child_key,
47 mojo::ui::ViewLayoutParamsPtr child_layout_params, 53 mojo::ui::ViewLayoutParamsPtr child_layout_params,
48 const LayoutChildCallback& callback) { 54 const LayoutChildCallback& callback) {
49 registry_->LayoutChild(state_, child_key, child_layout_params.Pass(), 55 registry_->LayoutChild(state_, child_key, child_layout_params.Pass(),
50 base::Bind(&RunLayoutChildCallback, callback)); 56 base::Bind(&RunLayoutChildCallback, callback));
51 } 57 }
52 58
59 void ViewHostImpl::ConnectToService(
60 const mojo::String& service_name,
61 mojo::ScopedMessagePipeHandle client_handle) {
62 registry_->ConnectToViewService(state_, service_name, client_handle.Pass());
63 }
64
53 } // namespace view_manager 65 } // namespace view_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698