Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Unified Diff: remoting/webapp/host_native_messaging.js

Issue 150423003: Add a minimum required version to the webapp manifest to ensure that native messaging is supported. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/appsv2.patch ('k') | remoting/webapp/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_native_messaging.js
diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js
index 8c76c424a3f535e45d05498212683b89b56af6f5..0d48b004091a97e14a077d26f1a4b41296147f86 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');
« no previous file with comments | « remoting/webapp/appsv2.patch ('k') | remoting/webapp/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698