| 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 /** | 5 /** |
| 6 * @fileoverview | 6 * @fileoverview |
| 7 * Class to communicate with the background scripts via chrome runtime | 7 * Class to communicate with the background scripts via chrome runtime |
| 8 * messages to | 8 * messages to |
| 9 * 1. Forward session state notifications | 9 * 1. Forward session state notifications |
| 10 * 2. Closes the window when the session terminates | 10 * 2. Closes the window when the session terminates |
| 11 */ | 11 */ |
| 12 | 12 |
| 13 'use strict'; | 13 'use strict'; |
| 14 | 14 |
| 15 /** @suppress {duplicate} */ | 15 /** @suppress {duplicate} */ |
| 16 var remoting = remoting || {}; | 16 var remoting = remoting || {}; |
| 17 | 17 |
| 18 /** | 18 /** |
| 19 * @constructor | 19 * @constructor |
| 20 */ | 20 */ |
| 21 remoting.HangoutSession = function() { | 21 remoting.HangoutSession = function() { |
| 22 /** | 22 /** |
| 23 * @private | 23 * @private |
| 24 * @type {chrome.extension.Port} | 24 * @type {chrome.runtime.Port} |
| 25 */ | 25 */ |
| 26 this.port_ = null; | 26 this.port_ = null; |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 remoting.HangoutSession.prototype.init = function() { | 29 remoting.HangoutSession.prototype.init = function() { |
| 30 this.port_ = chrome.runtime.connect({name: 'it2me.helper.webapp'}); | 30 this.port_ = chrome.runtime.connect({name: 'it2me.helper.webapp'}); |
| 31 | 31 |
| 32 remoting.hangoutSessionEvents.addEventListener( | 32 remoting.hangoutSessionEvents.addEventListener( |
| 33 remoting.hangoutSessionEvents.sessionStateChanged, | 33 remoting.hangoutSessionEvents.sessionStateChanged, |
| 34 this.onSessionStateChanged_.bind(this)); | 34 this.onSessionStateChanged_.bind(this)); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 63 * state changes until we cleanup clientSession and sessionConnector. | 63 * state changes until we cleanup clientSession and sessionConnector. |
| 64 * @type {base.EventSource} | 64 * @type {base.EventSource} |
| 65 */ | 65 */ |
| 66 remoting.hangoutSessionEvents = new base.EventSource(); | 66 remoting.hangoutSessionEvents = new base.EventSource(); |
| 67 | 67 |
| 68 /** @type {string} */ | 68 /** @type {string} */ |
| 69 remoting.hangoutSessionEvents.sessionStateChanged = "sessionStateChanged"; | 69 remoting.hangoutSessionEvents.sessionStateChanged = "sessionStateChanged"; |
| 70 | 70 |
| 71 remoting.hangoutSessionEvents.defineEvents( | 71 remoting.hangoutSessionEvents.defineEvents( |
| 72 [remoting.hangoutSessionEvents.sessionStateChanged]); | 72 [remoting.hangoutSessionEvents.sessionStateChanged]); |
| OLD | NEW |