| Index: remoting/webapp/crd/js/background.js
|
| diff --git a/remoting/webapp/crd/js/background.js b/remoting/webapp/crd/js/background.js
|
| index f3d5bea5c98d5ece80db81bb4df89631552f72fc..9eeea4d9e6374b7ba90a5f3d9bfcb8fb939fcdaa 100644
|
| --- a/remoting/webapp/crd/js/background.js
|
| +++ b/remoting/webapp/crd/js/background.js
|
| @@ -7,57 +7,7 @@ var remoting = remoting || {};
|
|
|
| (function(){
|
|
|
| -/**
|
| - * A class that handles application activation.
|
| - *
|
| - * @param {remoting.AppLauncher} appLauncher
|
| - * @constructor
|
| - */
|
| -function ActivationHandler(appLauncher) {
|
| - /**
|
| - * @type {remoting.AppLauncher}
|
| - * @private
|
| - */
|
| - this.appLauncher_ = appLauncher;
|
| -
|
| - chrome.contextMenus.create({
|
| - id: ActivationHandler.NEW_WINDOW_MENU_ID_,
|
| - contexts: ['launcher'],
|
| - title: chrome.i18n.getMessage(/*i18n-content*/'NEW_WINDOW')
|
| - });
|
| -
|
| - chrome.contextMenus.onClicked.addListener(this.onContextMenu_.bind(this));
|
| - chrome.app.runtime.onLaunched.addListener(this.onLaunched_.bind(this));
|
| -}
|
| -
|
| -/** @type {string} */
|
| -ActivationHandler.NEW_WINDOW_MENU_ID_ = 'new-window';
|
| -
|
| -/**
|
| - * @param {OnClickData} info
|
| - * @private
|
| - */
|
| -ActivationHandler.prototype.onContextMenu_ = function(info) {
|
| - if (info.menuItemId == ActivationHandler.NEW_WINDOW_MENU_ID_) {
|
| - this.appLauncher_.launch();
|
| - }
|
| -};
|
| -
|
| -/**
|
| - * Called when the App is activated (e.g. from the Chrome App Launcher). It
|
| - * creates a new window if there are no existing ones. Otherwise, it will put
|
| - * focus on the last window created.
|
| - *
|
| - * @private
|
| - */
|
| -ActivationHandler.prototype.onLaunched_ = function() {
|
| - var windows = chrome.app.window.getAll();
|
| - if (windows.length >= 1) {
|
| - windows[windows.length - 1].focus();
|
| - } else {
|
| - this.appLauncher_.launch();
|
| - }
|
| -};
|
| +'use strict';
|
|
|
| /**
|
| * The background service is responsible for listening to incoming connection
|
| @@ -86,7 +36,8 @@ function initializeBackgroundService(appLauncher) {
|
|
|
| function main() {
|
| if (base.isAppsV2()) {
|
| - new ActivationHandler(new remoting.V2AppLauncher());
|
| + new remoting.ActivationHandler(base.IPC.getInstance(),
|
| + new remoting.V2AppLauncher());
|
| }
|
| }
|
|
|
|
|