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

Unified Diff: remoting/webapp/base/js/application.js

Issue 895523004: [Chromoting] Add ability to enable/disable GDrive support per-app in gyp. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/base/js/application.js
diff --git a/remoting/webapp/base/js/application.js b/remoting/webapp/base/js/application.js
index 7390d8c21314ea191eddd7f40c18f2dc73cbd675..fd88108c745a2815043530fd75495cc1f87f9795 100644
--- a/remoting/webapp/base/js/application.js
+++ b/remoting/webapp/base/js/application.js
@@ -13,9 +13,10 @@
var remoting = remoting || {};
/**
+ * @param {Array.<string>} app_features Array of application features.
Jamie 2015/02/02 22:57:47 There's confusion in this file as to "features" vs
garykac 2015/02/03 01:50:21 Done.
* @constructor
*/
-remoting.Application = function() {
+remoting.Application = function(app_features) {
/**
* @type {remoting.Application.Delegate}
* @private
@@ -23,6 +24,12 @@ remoting.Application = function() {
this.delegate_ = null;
/**
+ * @type {Array.<string>}
+ * @private
+ */
+ this.app_features_ = app_features;
+
+ /**
* @type {remoting.SessionConnector}
* @private
*/
@@ -38,6 +45,25 @@ remoting.Application.prototype.setDelegate = function(appDelegate) {
};
/**
+ * @return {Array.<string>} A list of |ClientSession.Capability|s required
+ * by this application.
+ */
+remoting.Application.prototype.getRequiredCapabilities = function() {
+ var capabilities = [
+ remoting.ClientSession.Capability.SEND_INITIAL_RESOLUTION,
+ remoting.ClientSession.Capability.RATE_LIMIT_RESIZE_REQUESTS,
+ remoting.ClientSession.Capability.VIDEO_RECORDER
+ ];
+ if (this.app_features_.indexOf('cast') != -1) {
+ capabilities.push(remoting.ClientSession.Capability.CAST);
+ }
+ if (this.app_features_.indexOf('gdrive') != -1) {
+ capabilities.push(remoting.ClientSession.Capability.GOOGLE_DRIVE);
+ }
+ return capabilities;
+};
+
+/**
* Initialize the application and register all event handlers. After this
* is called, the app is running and waiting for user events.
*
@@ -153,7 +179,7 @@ remoting.Application.prototype.getSessionConnector = function() {
this.onError.bind(this),
this.onExtensionMessage.bind(this),
this.onConnectionFailed.bind(this),
- this.delegate_.getRequiredCapabilities(),
+ this.getRequiredCapabilities(),
this.delegate_.getDefaultRemapKeys());
}
return this.session_connector_;
@@ -180,12 +206,6 @@ remoting.Application.Delegate.prototype.init = function(connector) {};
remoting.Application.Delegate.prototype.getDefaultRemapKeys = function() {};
/**
- * @return {Array.<string>} A list of |ClientSession.Capability|s required
- * by this application.
- */
-remoting.Application.Delegate.prototype.getRequiredCapabilities = function() {};
-
-/**
* Called when a new session has been connected.
*
* @param {remoting.ClientSession} clientSession

Powered by Google App Engine
This is Rietveld 408576698