OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 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(appBridgeModule, spModule, shellModule) { |
| 10 |
| 11 class Application { |
| 12 constructor(appShell, url) { |
| 13 this.shell = new shellModule.Shell(appShell); |
| 14 this.url = url; |
| 15 this.serviceProviders = []; |
| 16 } |
| 17 |
| 18 initialize(args) { |
| 19 } |
| 20 |
| 21 acceptConnection_(url, spHandle) { |
| 22 var serviceProvider = new spModule.ServiceProvider(spHandle); |
| 23 this.serviceProviders.push(serviceProvider); |
| 24 this.acceptConnection(url, serviceProvider); |
| 25 } |
| 26 |
| 27 acceptConnection(url, serviceProvider) { |
| 28 } |
| 29 |
| 30 quit() { |
| 31 this.shell.close(); |
| 32 this.serviceProviders.forEach(function(sp) { |
| 33 sp.close(); |
| 34 }); |
| 35 appBridgeModule.quit(); |
| 36 } |
| 37 } |
| 38 |
| 39 var exports = {}; |
| 40 exports.Application = Application; |
| 41 return exports; |
| 42 }); |
OLD | NEW |