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 /** @suppress {duplicate} */
6 var remoting = remoting || {};
15 var BackgroundPage = function() {
16 /** @private {remoting.AppLauncher} */
17 this.appLauncher_ = null;
18 /** @private {remoting.ActivationHandler} */
19 this.activationHandler_ = null;
24 * Initialize members and globals that are valid throughout the entire lifetime
25 * of the background page.
29 BackgroundPage.prototype.preInit_ = function() {
30 remoting.settings = new remoting.Settings();
31 if (base.isAppsV2()) {
32 remoting.identity = new remoting.Identity();
34 remoting.oauth2 = new remoting.OAuth2();
35 var oauth2 = /** @type {*} */ (remoting.oauth2);
36 remoting.identity = /** @type {remoting.Identity} */ (oauth2);
39 if (base.isAppsV2()) {
40 this.appLauncher_ = new remoting.V2AppLauncher();
41 this.activationHandler_ = new remoting.ActivationHandler(
42 base.Ipc.getInstance(), this.appLauncher_);
44 this.appLauncher_ = new remoting.V1AppLauncher();
49 window.addEventListener('load', function() {
50 remoting.backgroundPage = new BackgroundPage();