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

Unified Diff: remoting/webapp/app_remoting/js/app_remoting.js

Issue 1163023002: [AppRemoting] Implements LicenseManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/app_remoting/js/app_remoting.js
diff --git a/remoting/webapp/app_remoting/js/app_remoting.js b/remoting/webapp/app_remoting/js/app_remoting.js
index 25a1f8d11ebae5245d068f2fb3e5bffdc5b3be32..a2040a60e342e227bc38eb20263b0007248a4dd7 100644
--- a/remoting/webapp/app_remoting/js/app_remoting.js
+++ b/remoting/webapp/app_remoting/js/app_remoting.js
@@ -15,17 +15,21 @@ var remoting = remoting || {};
/**
* @param {Array<string>} appCapabilities Array of application capabilities.
+ * @param {!remoting.LicenseManager} licenseManager
* @constructor
* @implements {remoting.ApplicationInterface}
* @extends {remoting.Application}
*/
-remoting.AppRemoting = function(appCapabilities) {
+remoting.AppRemoting = function(appCapabilities, licenseManager) {
base.inherits(this, remoting.Application);
/** @private {remoting.Activity} */
this.activity_ = null;
/** @private */
+ this.licenseManager_ = licenseManager;
+
+ /** @private */
this.appCapabilities_ = appCapabilities;
};
@@ -55,20 +59,23 @@ remoting.AppRemoting.prototype.signInFailed_ = function(error) {
/**
* @override {remoting.ApplicationInterface}
*/
-remoting.AppRemoting.prototype.initApplication_ = function() {
- var windowShape = new remoting.WindowShape();
- windowShape.updateClientWindowShape();
-
- this.activity_ = new remoting.AppRemotingActivity(this.appCapabilities_, this,
- windowShape);
-};
+remoting.AppRemoting.prototype.initApplication_ = function() {};
/**
* @param {string} token An OAuth access token.
* @override {remoting.ApplicationInterface}
*/
remoting.AppRemoting.prototype.startApplication_ = function(token) {
- this.activity_.start();
+ var windowShape = new remoting.WindowShape();
+ windowShape.updateClientWindowShape();
+ var that = this;
+
+ this.licenseManager_.getSubscriptionToken(token).then(
garykac 2015/06/04 22:13:43 We should allow licenseManager go be null and simp
kelvinp 2015/06/05 20:45:20 Good idea. Done
+ function(/** string*/ subscriptionToken) {
+ that.activity_ = new remoting.AppRemotingActivity(
+ that.appCapabilities_, that, windowShape, subscriptionToken);
+ that.activity_.start();
+ });
};
/**

Powered by Google App Engine
This is Rietveld 408576698