Index: mojo/services/public/js/application.js |
diff --git a/mojo/services/public/js/application.js b/mojo/services/public/js/application.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..58934241994b85e5494aba9ddbc0a7119b808b2d |
--- /dev/null |
+++ b/mojo/services/public/js/application.js |
@@ -0,0 +1,42 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+define("mojo/services/public/js/application", [ |
+ "services/js/app_bridge", |
+ "mojo/services/public/js/service_provider", |
+ "mojo/services/public/js/shell", |
+], function(appBridgeModule, spModule, shellModule) { |
+ |
+ class Application { |
+ constructor(appShell, url) { |
+ this.shell = new shellModule.Shell(appShell); |
+ this.url = url; |
+ this.serviceProviders = []; |
+ } |
+ |
+ initialize(args) { |
+ } |
+ |
+ acceptConnection_(url, spHandle) { |
+ var serviceProvider = new spModule.ServiceProvider(spHandle); |
+ this.serviceProviders.push(serviceProvider); |
+ this.acceptConnection(url, serviceProvider); |
+ } |
+ |
+ acceptConnection(url, serviceProvider) { |
+ } |
+ |
+ quit() { |
+ this.shell.close(); |
+ this.serviceProviders.forEach(function(sp) { |
+ sp.close(); |
+ }); |
+ appBridgeModule.quit(); |
+ } |
+ } |
+ |
+ var exports = {}; |
+ exports.Application = Application; |
+ return exports; |
+}); |