summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
Diffstat (limited to 'remoting')
-rw-r--r--remoting/remoting.gyp1
-rw-r--r--remoting/resources/remoting_strings.grd3
-rw-r--r--remoting/webapp/appsv2.patch5
-rw-r--r--remoting/webapp/background.js26
-rw-r--r--remoting/webapp/jscompiler_hacks.js30
5 files changed, 61 insertions, 4 deletions
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 8483289..df2800b 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -2358,6 +2358,7 @@
'host/win/core.rc.jinja2',
'host/win/host_messages.mc.jinja2',
'host/win/version.rc.jinja2',
+ 'webapp/background.js',
'webapp/butter_bar.js',
'webapp/client_screen.js',
'webapp/error.js',
diff --git a/remoting/resources/remoting_strings.grd b/remoting/resources/remoting_strings.grd
index a64fa8d..08d64e2 100644
--- a/remoting/resources/remoting_strings.grd
+++ b/remoting/resources/remoting_strings.grd
@@ -680,6 +680,9 @@
<message desc="Menu option to open a new connection." name="IDR_NEW_CONNECTION">
New connection…
</message>
+ <message desc="Menu option to open a new window." name="IDR_NEW_WINDOW">
+ New window…
+ </message>
</messages>
</release>
</grit>
diff --git a/remoting/webapp/appsv2.patch b/remoting/webapp/appsv2.patch
index 9deac20..7350ad4 100644
--- a/remoting/webapp/appsv2.patch
+++ b/remoting/webapp/appsv2.patch
@@ -37,13 +37,14 @@ index d1f8d1f..67bf660 100644
"optional_permissions": [
"<all_urls>"
],
-@@ -42,16 +28,21 @@
+@@ -42,16 +28,22 @@
"clipboardRead",
"clipboardWrite",
- "nativeMessaging"
+ "nativeMessaging",
+ "fullscreen",
-+ "identity"
++ "identity",
++ "contextMenus"
],
- "plugins": [
- { "path": "remoting_host_plugin.dll", "public": false },
diff --git a/remoting/webapp/background.js b/remoting/webapp/background.js
index 290b43a..118b7e57 100644
--- a/remoting/webapp/background.js
+++ b/remoting/webapp/background.js
@@ -2,9 +2,31 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-chrome.app.runtime.onLaunched.addListener(function() {
+/** @type {string} */
+var kNewWindowId = 'new-window';
+
+function createWindow() {
chrome.app.window.create('main.html', {
'width': 800,
'height': 600
});
-});
+};
+
+/** @param {OnClickData} info */
+function onContextMenu(info) {
+ if (info.menuItemId == kNewWindowId) {
+ createWindow();
+ }
+};
+
+function initializeContextMenu() {
+ chrome.contextMenus.create({
+ id: kNewWindowId,
+ contexts: ['launcher'],
+ title: chrome.i18n.getMessage(/*i18n-content*/'NEW_WINDOW')
+ });
+}
+
+chrome.app.runtime.onLaunched.addListener(createWindow);
+chrome.contextMenus.onClicked.addListener(onContextMenu);
+initializeContextMenu();
diff --git a/remoting/webapp/jscompiler_hacks.js b/remoting/webapp/jscompiler_hacks.js
index ad4d755..57c9419 100644
--- a/remoting/webapp/jscompiler_hacks.js
+++ b/remoting/webapp/jscompiler_hacks.js
@@ -121,6 +121,36 @@ chrome.app.window = {
create: function(name, parameters) {}
};
+/**
+ * @type {Object}
+ * @see http://code.google.com/chrome/extensions/dev/contextMenus.html
+ */
+chrome.contextMenus = {
+ /** @type {chrome.Event} */
+ onClicked: null,
+ /**
+ * @param {!Object} createProperties
+ * @param {function()=} opt_callback
+ * @return {string|number}
+ */
+ create: function(createProperties, opt_callback) {},
+ /**
+ * @param {string|number} menuItemId
+ * @param {function()=} opt_callback
+ */
+ remove: function(menuItemId, opt_callback) {},
+ /**
+ * @param {function()=} opt_callback
+ */
+ removeAll: function(opt_callback) {},
+ /**
+ * @param {string|number} id
+ * @param {!Object} updateProperties
+ * @param {function()=} opt_callback
+ */
+ update: function(id, updateProperties, opt_callback) {}
+};
+
/** @type {Object} */
chrome.identity = {
/**