1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * This class implements the functionality that is specific to application
8 * remoting ("AppRemoting" or AR).
13 /** @suppress {duplicate} */
14 var remoting = remoting || {};
17 * @param {Array<string>} appCapabilities Array of application capabilities.
19 * @implements {remoting.ApplicationInterface}
20 * @extends {remoting.Application}
22 remoting.AppRemoting = function(appCapabilities) {
23 base.inherits(this, remoting.Application);
25 /** @private {remoting.Activity} */
26 this.activity_ = null;
29 this.appCapabilities_ = appCapabilities;
33 * @return {string} Application product name to be used in UI.
34 * @override {remoting.ApplicationInterface}
36 remoting.AppRemoting.prototype.getApplicationName = function() {
37 var manifest = chrome.runtime.getManifest();
41 remoting.AppRemoting.prototype.getActivity = function() {
42 return this.activity_;
46 * @param {!remoting.Error} error The failure reason.
47 * @override {remoting.ApplicationInterface}
49 remoting.AppRemoting.prototype.signInFailed_ = function(error) {
50 remoting.MessageWindow.showErrorMessage(
51 this.getApplicationName(),
52 chrome.i18n.getMessage(error.getTag()));
56 * @override {remoting.ApplicationInterface}
58 remoting.AppRemoting.prototype.initApplication_ = function() {
59 remoting.windowShape.updateClientWindowShape();
62 new remoting.AppRemotingActivity(this.appCapabilities_, this);
66 * @param {string} token An OAuth access token.
67 * @override {remoting.ApplicationInterface}
69 remoting.AppRemoting.prototype.startApplication_ = function(token) {
70 this.activity_.start();
74 * @override {remoting.ApplicationInterface}
76 remoting.AppRemoting.prototype.exitApplication_ = function() {
77 this.activity_.dispose();
78 this.closeMainWindow_();