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

Unified Diff: remoting/webapp/client_plugin.js

Issue 464133003: CastExtensionHandler for Chromoting Webapp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « remoting/webapp/cast_extension_handler.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/client_plugin.js
diff --git a/remoting/webapp/client_plugin.js b/remoting/webapp/client_plugin.js
index 7b854a20698c7c7f01b840dfca33f21375e990fb..23896e0b8a5676e4186abde33f16a0589616959b 100644
--- a/remoting/webapp/client_plugin.js
+++ b/remoting/webapp/client_plugin.js
@@ -64,6 +64,9 @@ remoting.ClientPlugin = function(plugin, onExtensionMessage) {
*/
this.updateMouseCursorImage = function(url, hotspotX, hotspotY) {};
+ /** @param {string} data Remote cast extension message. */
+ this.onCastExtensionHandler = function(data) {};
+
/** @type {remoting.MediaSourceRenderer} */
this.mediaSourceRenderer_ = null;
@@ -221,6 +224,13 @@ remoting.ClientPlugin.prototype.handleMessageMethod_ = function(message) {
// Let the host know that we can use the video framerecording extension.
this.capabilities_.push(
remoting.ClientSession.Capability.VIDEO_RECORDER);
+
+ // Let the host know that we can support casting of the screen.
+ // TODO(aiguha): Add this capability based on a gyp/command-line flag,
+ // rather than by default.
+ this.capabilities_.push(
+ remoting.ClientSession.Capability.CAST);
+
} else if (this.pluginApiVersion_ >= 6) {
this.pluginApiFeatures_ = ['highQualityScaling', 'injectKeyEvent'];
} else {
@@ -315,6 +325,9 @@ remoting.ClientPlugin.prototype.handleMessageMethod_ = function(message) {
case 'test-echo-reply':
console.log('Got echo reply: ' + extMsgData);
break;
+ case 'cast_message':
aiguha 2014/08/13 01:29:33 Should we also check here if the capability is ena
+ this.onCastExtensionHandler(extMsgData);
+ break;
default:
if (!this.onExtensionMessage_(extMsgType, extMsgData)) {
console.log('Unexpected message received: ' +
« no previous file with comments | « remoting/webapp/cast_extension_handler.js ('k') | remoting/webapp/client_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698