OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 define("mojo/services/public/js/application", [ | 5 define("mojo/services/public/js/application", [ |
6 "services/js/app_bridge", | |
7 "mojo/services/public/js/service_provider", | 6 "mojo/services/public/js/service_provider", |
8 "mojo/services/public/js/shell", | 7 "mojo/services/public/js/shell", |
9 ], function(appBridge, serviceProvider, shell) { | 8 "mojo/public/js/threading", |
| 9 ], function(serviceProvider, shell, threading) { |
10 | 10 |
11 const ServiceProvider = serviceProvider.ServiceProvider; | 11 const ServiceProvider = serviceProvider.ServiceProvider; |
12 const Shell = shell.Shell; | 12 const Shell = shell.Shell; |
13 | 13 |
14 class Application { | 14 class Application { |
15 constructor(shellHandle, url) { | 15 constructor(shellHandle, url) { |
16 this.url = url; | 16 this.url = url; |
17 this.serviceProviders = []; | 17 this.serviceProviders = []; |
18 this.shellHandle_ = shellHandle; | 18 this.shellHandle_ = shellHandle; |
19 this.shell = new Shell(shellHandle, { | 19 this.shell = new Shell(shellHandle, { |
(...skipping 12 matching lines...) Expand all Loading... |
32 } | 32 } |
33 | 33 |
34 acceptConnection(url, serviceProvider) { | 34 acceptConnection(url, serviceProvider) { |
35 } | 35 } |
36 | 36 |
37 quit() { | 37 quit() { |
38 this.serviceProviders.forEach(function(sp) { | 38 this.serviceProviders.forEach(function(sp) { |
39 sp.close(); | 39 sp.close(); |
40 }); | 40 }); |
41 this.shell.close(); | 41 this.shell.close(); |
42 appBridge.quit(); | 42 threading.quit(); |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 var exports = {}; | 46 var exports = {}; |
47 exports.Application = Application; | 47 exports.Application = Application; |
48 return exports; | 48 return exports; |
49 }); | 49 }); |
OLD | NEW |