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

Unified Diff: remoting/webapp/host_screen.js

Issue 340993002: Revert of Remove NPAPI plugin from chromoting webapp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/host_it2me_dispatcher.js ('k') | remoting/webapp/host_session.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_screen.js
diff --git a/remoting/webapp/host_screen.js b/remoting/webapp/host_screen.js
index bfa3827b7d1f09f255857916c270cfecdcff5e26..d1a26fcb11de2e13684ea61ebe94229c2139f398 100644
--- a/remoting/webapp/host_screen.js
+++ b/remoting/webapp/host_screen.js
@@ -33,13 +33,25 @@
var hostInstallDialog = null;
var tryInitializeDispatcher = function() {
- hostDispatcher.initialize(onDispatcherInitialized,
+ hostDispatcher.initialize(createPluginForIt2Me,
+ onDispatcherInitialized,
onDispatcherInitializationFailed);
}
+ /** @return {remoting.HostPlugin} */
+ var createPluginForIt2Me = function() {
+ return remoting.createNpapiPlugin(
+ document.getElementById('host-plugin-container'));
+ }
+
var onDispatcherInitialized = function () {
- // Host already installed.
- remoting.startHostUsingDispatcher_(hostDispatcher);
+ if (hostDispatcher.usingNpapi()) {
+ hostInstallDialog = new remoting.HostInstallDialog();
+ hostInstallDialog.show(tryInitializeDispatcher, onInstallError);
+ } else {
+ // Host alrady installed.
+ remoting.startHostUsingDispatcher_(hostDispatcher);
+ }
};
/** @param {remoting.Error} error */
@@ -169,6 +181,8 @@
remoting.setMode(remoting.AppMode.HOST_SHARE_FINISHED);
}
}
+ remoting.hostSession.cleanup();
+
} else if (state == remoting.HostSession.State.ERROR) {
console.error('Host state: ERROR');
showShareError_(remoting.Error.UNEXPECTED);
« no previous file with comments | « remoting/webapp/host_it2me_dispatcher.js ('k') | remoting/webapp/host_session.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698