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
3 // found in the LICENSE file.
5 #include "components/window_manager/window_manager_impl.h"
7 #include "components/window_manager/window_manager_app.h"
9 namespace window_manager
{
11 WindowManagerImpl::WindowManagerImpl(WindowManagerApp
* window_manager
,
13 : window_manager_(window_manager
), from_vm_(from_vm
), binding_(this) {
14 window_manager_
->AddConnection(this);
15 binding_
.set_error_handler(this);
18 WindowManagerImpl::~WindowManagerImpl() {
19 window_manager_
->RemoveConnection(this);
22 void WindowManagerImpl::Bind(
23 mojo::ScopedMessagePipeHandle window_manager_pipe
) {
24 binding_
.Bind(window_manager_pipe
.Pass());
27 void WindowManagerImpl::Embed(
28 const mojo::String
& url
,
29 mojo::InterfaceRequest
<mojo::ServiceProvider
> services
,
30 mojo::ServiceProviderPtr exposed_services
) {
31 window_manager_
->Embed(url
, services
.Pass(), exposed_services
.Pass());
34 void WindowManagerImpl::OnConnectionError() {
38 } // namespace window_manager