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 define("mojo/services/public/js/application", [
6 "services/js/app_bridge",
7 "mojo/services/public/js/service_provider",
8 "mojo/services/public/js/shell",
9 ], function(appBridge
, serviceProvider
, shell
) {
11 const ServiceProvider
= serviceProvider
.ServiceProvider
;
12 const Shell
= shell
.Shell
;
15 constructor(shellHandle
, url
) {
17 this.serviceProviders
= [];
18 this.shellHandle_
= shellHandle
;
19 this.shell
= new Shell(shellHandle
, {
20 initialize
: this.initialize
.bind(this),
21 acceptConnection
: this.doAcceptConnection
.bind(this),
28 doAcceptConnection(url
, serviceProviderProxy
) {
29 var serviceProvider
= new ServiceProvider(serviceProviderProxy
);
30 this.serviceProviders
.push(serviceProvider
);
31 this.acceptConnection(url
, serviceProvider
);
34 acceptConnection(url
, serviceProvider
) {
38 this.serviceProviders
.forEach(function(sp
) {
47 exports
.Application
= Application
;