diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 22:56:37 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 22:56:37 +0000 |
commit | 0398c320ae167c350ee3fc8d79e6a4ecf94f25df (patch) | |
tree | 12711b2dfb5e8198c90080b39facee05080acaca /remoting/webapp/host_plugin_wrapper.js | |
parent | a0ee86c8d352a4768ee9f7532b14c53274225cf3 (diff) | |
download | chromium_src-0398c320ae167c350ee3fc8d79e6a4ecf94f25df.zip chromium_src-0398c320ae167c350ee3fc8d79e6a4ecf94f25df.tar.gz chromium_src-0398c320ae167c350ee3fc8d79e6a4ecf94f25df.tar.bz2 |
Dispatch HostController requests to NativeMessaging host or NPAPI plugin.
Add HostDispatcher class which tries to initialize
NativeMessaging, falling back to the NPAPI plugin if
NativeMessaging is unsupported. The HostController makes
all Me2Me requests via this new class, which dispatches
them to the NativeMessaging host or the NPAPI plugin. If
support status is not yet known (the test is asynchronous),
the request is added to a pending queue, and is dispatched
when the status has been determined.
BUG=173509
Review URL: https://chromiumcodereview.appspot.com/14780005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp/host_plugin_wrapper.js')
-rw-r--r-- | remoting/webapp/host_plugin_wrapper.js | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/remoting/webapp/host_plugin_wrapper.js b/remoting/webapp/host_plugin_wrapper.js deleted file mode 100644 index 870eec3..0000000 --- a/remoting/webapp/host_plugin_wrapper.js +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// This file provides a compatibility wrapper around the NPAPI plugin object, -// exposing an interface that matches the Native Messaging interface. - -// TODO(lambroslambrou): Add error callback parameters here, and in Native -// Messaging. The extra callback parameters will be ignored here. - -/** @suppress {duplicate} */ -var remoting = remoting || {}; - -/** - * @constructor - * @param {remoting.HostPlugin} plugin Wrapped NPAPI plugin object. - * @extends remoting.HostNativeMessaging - */ -remoting.HostPluginWrapper = function(plugin) { - /** @type {remoting.HostPlugin} @private */ - this.plugin_ = plugin; -}; - -/** - * @param {function(string):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getHostName = function(callback) { - this.plugin_.getHostName(callback); -}; - -/** - * @param {string} hostId - * @param {string} pin - * @param {function(string):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getPinHash = function(hostId, pin, - callback) { - this.plugin_.getPinHash(hostId, pin, callback); -}; - -/** - * @param {function(string, string):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.generateKeyPair = function(callback) { - this.plugin_.generateKeyPair(callback); -}; - -/** - * @param {string} config - * @param {function(remoting.HostController.AsyncResult):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.updateDaemonConfig = function(config, - callback) { - this.plugin_.updateDaemonConfig(config, callback); -}; - -/** - * @param {function(string):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getDaemonConfig = function(callback) { - this.plugin_.getDaemonConfig(callback); -}; - -/** - * @param {function(string):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getDaemonVersion = function(callback) { - this.plugin_.getDaemonVersion(callback); -}; - -/** - * @param {function(boolean, boolean, boolean):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getUsageStatsConsent = function(callback) { - this.plugin_.getUsageStatsConsent(callback); -}; - -/** - * @param {string} config - * @param {function(remoting.HostController.AsyncResult):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.startDaemon = function( - config, consent, callback) { - this.plugin_.startDaemon(config, consent, callback); -}; - -/** - * @param {function(remoting.HostController.AsyncResult):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.stopDaemon = function(callback) { - this.plugin_.stopDaemon(callback); -}; - -/** - * @param {function(remoting.HostController.State):void} callback - * @return {void} - */ -remoting.HostPluginWrapper.prototype.getDaemonState = function(callback) { - // Call the callback directly, since NPAPI exposes the state directly as a - // field member, rather than an asynchronous method. - var state = this.plugin_.daemonState; - if (state === undefined) { - // If the plug-in can't be instantiated, for example on ChromeOS, then - // return something sensible. - state = remoting.HostController.State.NOT_IMPLEMENTED; - } - callback(state); -} |