Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(923)

Unified Diff: remoting/webapp/background/background.js

Issue 468693002: Hangouts remote desktop part III - It2MeService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix UT failure Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/background/app_launcher.js ('k') | remoting/webapp/background/it2me_helper_channel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/background/background.js
diff --git a/remoting/webapp/background/background.js b/remoting/webapp/background/background.js
index 5f2678898e2a13f6e782b0c85e16586463091920..28c20105185d94023b38e20f430d55109a010f91 100644
--- a/remoting/webapp/background/background.js
+++ b/remoting/webapp/background/background.js
@@ -43,6 +43,29 @@ function initializeAppV2(appLauncher) {
);
}
+/**
+ * The background service is responsible for listening to incoming connection
+ * requests from Hangouts and the webapp.
+ *
+ * @param {remoting.AppLauncher} appLauncher
+ */
+function initializeBackgroundService(appLauncher) {
+ function initializeIt2MeService() {
+ /** @type {remoting.It2MeService} */
+ remoting.it2meService = new remoting.It2MeService(appLauncher);
+ remoting.it2meService.init();
+ }
+
+ chrome.runtime.onSuspend.addListener(function() {
+ base.debug.assert(remoting.it2meService != null);
+ remoting.it2meService.dispose();
+ remoting.it2meService = null;
+ });
+
+ chrome.runtime.onSuspendCanceled.addListener(initializeIt2MeService);
+ initializeIt2MeService();
+}
+
function main() {
/** @type {remoting.AppLauncher} */
var appLauncher = new remoting.V1AppLauncher();
@@ -50,6 +73,7 @@ function main() {
appLauncher = new remoting.V2AppLauncher();
initializeAppV2(appLauncher);
}
+ initializeBackgroundService(appLauncher);
}
window.addEventListener('load', main, false);
« no previous file with comments | « remoting/webapp/background/app_launcher.js ('k') | remoting/webapp/background/it2me_helper_channel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698