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

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

Issue 473073002: Move hello message from It2MeService to It2MeChannel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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.
*

Powered by Google App Engine
This is Rietveld 408576698