Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / remoting / webapp / app_remoting / js / app_remoting.js
bloba35aa7d4a4e1d948e996ed10fb53fe2d4d2192e4
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.
5 /**
6  * @fileoverview
7  * This class implements the functionality that is specific to application
8  * remoting ("AppRemoting" or AR).
9  */
11 'use strict';
13 /** @suppress {duplicate} */
14 var remoting = remoting || {};
16 /**
17  * @param {Array<string>} appCapabilities Array of application capabilities.
18  * @constructor
19  * @implements {remoting.ApplicationInterface}
20  * @extends {remoting.Application}
21  */
22 remoting.AppRemoting = function(appCapabilities) {
23   base.inherits(this, remoting.Application);
25   /** @private {remoting.Activity} */
26   this.activity_ = null;
28   /** @private */
29   this.appCapabilities_ = appCapabilities;
32 /**
33  * @return {string} Application product name to be used in UI.
34  * @override {remoting.ApplicationInterface}
35  */
36 remoting.AppRemoting.prototype.getApplicationName = function() {
37   var manifest = chrome.runtime.getManifest();
38   return manifest.name;
41 remoting.AppRemoting.prototype.getActivity = function() {
42   return this.activity_;
45 /**
46  * @param {!remoting.Error} error The failure reason.
47  * @override {remoting.ApplicationInterface}
48  */
49 remoting.AppRemoting.prototype.signInFailed_ = function(error) {
50   remoting.MessageWindow.showErrorMessage(
51       this.getApplicationName(),
52       chrome.i18n.getMessage(error.getTag()));
55 /**
56  * @override {remoting.ApplicationInterface}
57  */
58 remoting.AppRemoting.prototype.initApplication_ = function() {
59   remoting.windowShape.updateClientWindowShape();
61   this.activity_ =
62       new remoting.AppRemotingActivity(this.appCapabilities_, this);
65 /**
66  * @param {string} token An OAuth access token.
67  * @override {remoting.ApplicationInterface}
68  */
69 remoting.AppRemoting.prototype.startApplication_ = function(token) {
70   this.activity_.start();
73 /**
74  * @override {remoting.ApplicationInterface}
75  */
76 remoting.AppRemoting.prototype.exitApplication_ = function() {
77   this.activity_.dispose();
78   this.closeMainWindow_();