Index: remoting/webapp/background/it2me_service.js |
diff --git a/remoting/webapp/background/it2me_service.js b/remoting/webapp/background/it2me_service.js |
index 9656864577fa8dfe22f9cedfd14509e8eaa7b912..93cb9a9e132354990ed7e3502f133c313a563ed5 100644 |
--- a/remoting/webapp/background/it2me_service.js |
+++ b/remoting/webapp/background/it2me_service.js |
@@ -35,7 +35,6 @@ remoting.It2MeService = function(appLauncher) { |
this.helpee_ = null; |
this.onWebappConnectRef_ = this.onWebappConnect_.bind(this); |
- this.onMessageExternalRef_ = this.onMessageExternal_.bind(this); |
Jamie
2014/08/15 19:11:46
Did you intend to remove this? There's nothing in
kelvinp
2014/08/15 21:28:32
Yes, it is intended. Currently, the only external
|
this.onConnectExternalRef_ = this.onConnectExternal_.bind(this); |
}; |
@@ -51,53 +50,16 @@ remoting.It2MeService.ConnectionTypes = { |
*/ |
remoting.It2MeService.prototype.init = function() { |
chrome.runtime.onConnect.addListener(this.onWebappConnectRef_); |
- chrome.runtime.onMessageExternal.addListener(this.onMessageExternalRef_); |
chrome.runtime.onConnectExternal.addListener(this.onConnectExternalRef_); |
}; |
remoting.It2MeService.prototype.dispose = function() { |
chrome.runtime.onConnect.removeListener(this.onWebappConnectRef_); |
- chrome.runtime.onMessageExternal.removeListener( |
- this.onMessageExternalRef_); |
chrome.runtime.onConnectExternal.removeListener( |
this.onConnectExternalRef_); |
}; |
/** |
- * This function is called when a runtime message is received from an external |
- * web page (hangout) or extension. |
- * |
- * @param {{method:string, data:Object.<string,*>}} message |
- * @param {chrome.runtime.MessageSender} sender |
- * @param {function(*):void} sendResponse |
- * @private |
- */ |
-remoting.It2MeService.prototype.onMessageExternal_ = |
- function(message, sender, sendResponse) { |
- try { |
- var method = message.method; |
- if (method == 'hello') { |
- // The hello message is used by hangouts to detect whether the app is |
- // installed and what features are supported. |
- sendResponse({ |
- method: 'helloResponse', |
- supportedFeatures: ['it2me'] |
- }); |
- return true; |
- } |
- throw new Error('Unknown method: ' + method); |
- } catch (e) { |
- var error = /** @type {Error} */ e; |
- console.error(error); |
- sendResponse({ |
- method: message.method + 'Response', |
- error: error.message |
- }); |
- } |
- return false; |
-}; |
- |
-/** |
* This function is called when Hangouts connects via chrome.runtime.connect. |
* Only web pages that are white-listed in the manifest are allowed to connect. |
* |