summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-31 21:24:02 +0000
committerweitaosu@chromium.org <weitaosu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-31 21:24:02 +0000
commitdef0ee8f95470a4a7591897419d305072a0689fd (patch)
tree03deee3f620f7fe8c54fd24d26f6d5cf495cbdf1 /remoting
parentc0efbf772fd2054d27888dcc743465a0631b4296 (diff)
downloadchromium_src-def0ee8f95470a4a7591897419d305072a0689fd.zip
chromium_src-def0ee8f95470a4a7591897419d305072a0689fd.tar.gz
chromium_src-def0ee8f95470a4a7591897419d305072a0689fd.tar.bz2
Add a minimum required version to the webapp manifest to ensure that native messaging is supported.
BUG=309844 Review URL: https://codereview.chromium.org/150423003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@248271 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/webapp/appsv2.patch6
-rw-r--r--remoting/webapp/host_native_messaging.js20
-rw-r--r--remoting/webapp/manifest.json1
3 files changed, 6 insertions, 21 deletions
diff --git a/remoting/webapp/appsv2.patch b/remoting/webapp/appsv2.patch
index 7350ad4..e8b2664 100644
--- a/remoting/webapp/appsv2.patch
+++ b/remoting/webapp/appsv2.patch
@@ -2,9 +2,9 @@ diff --git a/remoting/webapp/manifest.json b/remoting/webapp/manifest.json
index d1f8d1f..67bf660 100644
--- a/manifest.json
+++ b/manifest.json
-@@ -5,30 +5,15 @@
- "manifest_version": 2,
+@@ -6,30 +6,15 @@
"default_locale": "en",
+ "minimum_chrome_version": "32",
"app": {
- "launch": {
- "local_path": "main.html"
@@ -37,7 +37,7 @@ index d1f8d1f..67bf660 100644
"optional_permissions": [
"<all_urls>"
],
-@@ -42,16 +28,22 @@
+@@ -43,16 +29,22 @@
"clipboardRead",
"clipboardWrite",
- "nativeMessaging"
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js
index 8c76c42..0d48b00 100644
--- a/remoting/webapp/host_native_messaging.js
+++ b/remoting/webapp/host_native_messaging.js
@@ -56,8 +56,8 @@ remoting.HostNativeMessaging.PendingReply = function(type, onDone, onError) {
/**
* Sets up connection to the Native Messaging host process and exchanges
- * 'hello' messages. If Native Messaging is not available or the host
- * process is not installed, this returns false to the callback.
+ * 'hello' messages. Invokes onDone on success and onError on failure (the
+ * native messaging host is probably not installed).
*
* @param {function(): void} onDone Called after successful initialization.
* @param {function(remoting.Error): void} onError Called if initialization
@@ -65,22 +65,6 @@ remoting.HostNativeMessaging.PendingReply = function(type, onDone, onError) {
* @return {void} Nothing.
*/
remoting.HostNativeMessaging.prototype.initialize = function(onDone, onError) {
- if (!chrome.runtime.connectNative) {
- console.log('Native Messaging API not available');
- onError(remoting.Error.UNEXPECTED);
- return;
- }
-
- // NativeMessaging API exists on Chrome 26.xxx but fails to notify
- // onDisconnect in the case where the Host components are not installed. Need
- // to blacklist these versions of Chrome.
- var majorVersion = navigator.appVersion.match('Chrome/(\\d+)\.')[1];
- if (!majorVersion || majorVersion <= 26) {
- console.log('Native Messaging not supported on this version of Chrome');
- onError(remoting.Error.UNEXPECTED);
- return;
- }
-
try {
this.port_ = chrome.runtime.connectNative(
'com.google.chrome.remote_desktop');
diff --git a/remoting/webapp/manifest.json b/remoting/webapp/manifest.json
index 91b732d..214be9f 100644
--- a/remoting/webapp/manifest.json
+++ b/remoting/webapp/manifest.json
@@ -5,6 +5,7 @@
"description": "__MSG_PRODUCT_DESCRIPTION__",
"manifest_version": 2,
"default_locale": "en",
+ "minimum_chrome_version": "32",
"app": {
"launch": {
"local_path": "main.html"