diff --git a/remoting/webapp/event_handlers.js b/remoting/webapp/event_handlers.js index 5dfc368..f69d984 100644 --- a/event_handlers.js +++ b/event_handlers.js @@ -57,7 +57,6 @@ function onLoad() { fn: remoting.sendCtrlAltDel }, { event: 'click', id: 'send-print-screen', fn: remoting.sendPrintScreen }, - { event: 'click', id: 'auth-button', fn: doAuthRedirect }, { event: 'click', id: 'share-button', fn: remoting.tryShare }, { event: 'click', id: 'access-mode-button', fn: goEnterAccessCode }, { event: 'click', id: 'cancel-share-button', fn: remoting.cancelShare }, @@ -118,6 +117,4 @@ function onBeforeUnload() { } window.addEventListener('load', onLoad, false); -window.addEventListener('beforeunload', onBeforeUnload, false); window.addEventListener('resize', remoting.onResize, false); -window.addEventListener('unload', remoting.disconnect, false); diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js index 83c9844..98f63c3 100644 --- a/host_controller.js +++ b/host_controller.js @@ -341,7 +341,7 @@ remoting.HostController.prototype.getLocalHostStateAndId = function(onDone) { onDone(state, that.localHostId_); }; try { - this.plugin_.getDaemonConfig(onConfig); + onConfig('{}'); } catch (err) { onDone(remoting.HostController.State.NOT_IMPLEMENTED, null); } diff --git a/remoting/webapp/host_table_entry.js b/remoting/webapp/host_table_entry.js index 4eb09d9..6d2ce85 100644 --- a/host_table_entry.js +++ b/host_table_entry.js @@ -191,9 +191,7 @@ remoting.HostTableEntry.prototype.updateStatus = function(opt_forEdit) { /** @type {string} */ var encodedHostId = encodeURIComponent(this.host.hostId) this.onConnectReference_ = function() { - var hostUrl = chrome.extension.getURL('main.html') + - '?mode=me2me&hostId=' + encodedHostId; - window.location.assign(hostUrl); + remoting.connectMe2Me(encodedHostId, true); }; this.tableRow.addEventListener('click', this.onConnectReference_, false); } diff --git a/remoting/webapp/main.html b/remoting/webapp/main.html index 061caeb..f61e532 100644 --- a/main.html +++ b/main.html @@ -33,6 +33,7 @@ found in the LICENSE file. + diff --git a/remoting/webapp/manifest.json b/remoting/webapp/manifest.json index 5be9243..39052b9 100644 --- a/manifest.json +++ b/manifest.json @@ -5,24 +5,16 @@ "manifest_version": 2, "default_locale": "en", "app": { - "launch": { - "local_path": "main.html" + "background": { + "scripts": ["background.js"] } }, + "key": "chromotingappsv2", "icons": { "128": "chromoting128.webp", "48": "chromoting48.webp", "16": "chromoting16.webp" }, - "content_scripts": [ - { - "matches": [ - "OAUTH2_REDIRECT_URL" - ], - "js": [ "cs_oauth2_trampoline.js" ] - } - ], - "content_security_policy": "default-src 'self'; script-src 'self' TALK_GADGET_HOST; style-src 'self' https://fonts.googleapis.com; img-src 'self' TALK_GADGET_HOST; font-src *; connect-src 'self' OAUTH2_ACCOUNTS_HOST GOOGLE_API_HOSTS TALK_GADGET_HOST https://relay.google.com", "permissions": [ "OAUTH2_ACCOUNTS_HOST/*", "OAUTH2_API_BASE_URL/*", @@ -30,17 +22,22 @@ "TALK_GADGET_HOST/talkgadget/*", "https://relay.google.com/*", "clipboardRead", - "clipboardWrite" - ], - "plugins": [ - { "path": "remoting_host_plugin.dll", "public": false }, - { "path": "libremoting_host_plugin.ia32.so", "public": false }, - { "path": "libremoting_host_plugin.x64.so", "public": false }, - { "path": "remoting_host_plugin.plugin", "public": false } + "clipboardWrite", + "experimental", + "storage" ], + "oauth2": { + "client_id": "45833509441.apps.googleusercontent.com", + "scopes": [ + "https://www.googleapis.com/auth/chromoting https://www.googleapis.com/auth/googletalk https://www.googleapis.com/auth/userinfo#email" + ] + }, "requirements": { "plugins": { "npapi": false } + }, + "sandbox": { + "pages": [ "wcs_sandbox.html" ] } } diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js index f89072a..2fadd83 100644 --- a/remoting.js +++ b/remoting.js @@ -43,10 +43,7 @@ remoting.init = function() { // Create global objects. remoting.settings = new remoting.Settings(); remoting.oauth2 = new remoting.OAuth2(); - // TODO(jamiewalch): Reinstate this when we migrate to apps v2 - // (http://crbug.com/ 134213). - // remoting.identity = new remoting.Identity(consentRequired_); - remoting.identity = remoting.oauth2; + remoting.identity = new remoting.Identity(consentRequired_); remoting.stats = new remoting.ConnectionStats( document.getElementById('statistics')); remoting.formatIq = new remoting.FormatIq(); @@ -118,9 +115,6 @@ remoting.initDaemonUi = function () { document.getElementById('share-button').disabled = !remoting.hostController.isPluginSupported(); remoting.setMode(remoting.AppMode.HOME); - if (!remoting.oauth2.isAuthenticated()) { - document.getElementById('auth-dialog').hidden = false; - } remoting.hostSetupDialog = new remoting.HostSetupDialog(remoting.hostController); // Display the cached host list, then asynchronously update and re-display it. diff --git a/remoting/webapp/xhr_proxy.js b/remoting/webapp/xhr_proxy.js index 4c45780..653b481 100644 --- a/xhr_proxy.js +++ b/xhr_proxy.js @@ -90,4 +90,4 @@ remoting.XMLHttpRequestProxy.prototype.DONE = 4; // Since the WCS driver code constructs XHRs directly, the only mechanism for // proxying them is to replace the XMLHttpRequest constructor. -//XMLHttpRequest = remoting.XMLHttpRequestProxy; +XMLHttpRequest = remoting.XMLHttpRequestProxy;