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

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: Reviewer's feedback Created 5 years, 6 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/app_remoting_webapp_files.gypi ('k') | remoting/webapp/app_remoting/js/app_remoting_activity.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..87b913464aa822518e96ba9a401737a9ab9e79e4 100644
--- a/remoting/webapp/app_remoting/js/app_remoting.js
+++ b/remoting/webapp/app_remoting/js/app_remoting.js
@@ -15,17 +15,23 @@ var remoting = remoting || {};
/**
* @param {Array<string>} appCapabilities Array of application capabilities.
+ * @param {remoting.LicenseManager=} opt_licenseManager
* @constructor
* @implements {remoting.ApplicationInterface}
* @extends {remoting.Application}
*/
-remoting.AppRemoting = function(appCapabilities) {
+remoting.AppRemoting = function(appCapabilities, opt_licenseManager) {
base.inherits(this, remoting.Application);
/** @private {remoting.Activity} */
this.activity_ = null;
/** @private */
+ this.licenseManager_ = (opt_licenseManager) ?
+ opt_licenseManager :
+ new remoting.GaiaLicenseManager();
+
+ /** @private */
this.appCapabilities_ = appCapabilities;
};
@@ -55,20 +61,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(
+ function(/** string*/ subscriptionToken) {
+ that.activity_ = new remoting.AppRemotingActivity(
+ that.appCapabilities_, that, windowShape, subscriptionToken);
+ that.activity_.start();
+ });
};
/**
« no previous file with comments | « remoting/app_remoting_webapp_files.gypi ('k') | remoting/webapp/app_remoting/js/app_remoting_activity.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698