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/shell", [ | 5 define("mojo/services/public/js/shell", [ |
6 "mojo/public/js/bindings", | 6 "mojo/public/js/bindings", |
7 "mojo/public/js/core", | 7 "mojo/public/js/core", |
8 "mojo/public/js/connection", | 8 "mojo/public/js/connection", |
9 "mojo/public/interfaces/application/shell.mojom", | 9 "mojo/public/interfaces/application/shell.mojom", |
10 "mojo/public/interfaces/application/service_provider.mojom", | 10 "mojo/public/interfaces/application/service_provider.mojom", |
11 "mojo/services/public/js/service_provider", | 11 "mojo/services/public/js/service_provider", |
12 ], function(bindings, | 12 ], function(bindings, core, connection, shellMojom, spMojom, sp) { |
13 core, | |
14 connection, | |
15 shellMojom, | |
16 serviceProviderMojom, | |
17 serviceProvider) { | |
18 | 13 |
19 const ProxyBindings = bindings.ProxyBindings; | 14 const ProxyBindings = bindings.ProxyBindings; |
20 const StubBindings = bindings.StubBindings; | 15 const StubBindings = bindings.StubBindings; |
21 const ServiceProvider = serviceProvider.ServiceProvider; | 16 const ServiceProvider = sp.ServiceProvider; |
22 const ServiceProviderInterface = serviceProviderMojom.ServiceProvider; | 17 const ServiceProviderInterface = spMojom.ServiceProvider; |
23 const ShellInterface = shellMojom.Shell; | 18 const ShellInterface = shellMojom.Shell; |
24 | 19 |
25 class Shell { | 20 class Shell { |
26 constructor(shellHandle, app) { | 21 constructor(shellHandle, app) { |
27 this.shellHandle = shellHandle; | 22 this.shellHandle = shellHandle; |
28 this.proxy = connection.bindProxyHandle( | 23 this.proxy = connection.bindProxyHandle( |
29 shellHandle, ShellInterface.client, ShellInterface); | 24 shellHandle, ShellInterface.client, ShellInterface); |
30 | 25 |
31 ProxyBindings(this.proxy).setLocalDelegate(app); | 26 ProxyBindings(this.proxy).setLocalDelegate(app); |
32 // TODO: call this serviceProviders_ | 27 // TODO: call this serviceProviders_ |
(...skipping 22 matching lines...) Expand all Loading... |
55 }); | 50 }); |
56 this.applications_.clear(); | 51 this.applications_.clear(); |
57 core.close(this.shellHandle); | 52 core.close(this.shellHandle); |
58 } | 53 } |
59 } | 54 } |
60 | 55 |
61 var exports = {}; | 56 var exports = {}; |
62 exports.Shell = Shell; | 57 exports.Shell = Shell; |
63 return exports; | 58 return exports; |
64 }); | 59 }); |
OLD | NEW |