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 @@ -54,7 +54,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 }, @@ -104,6 +103,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/main.html b/remoting/webapp/main.html index 061caeb..f61e532 100644 --- a/main.html +++ b/main.html @@ -35,6 +35,7 @@ found in the LICENSE file. + 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, "default_locale": "en", "app": { - "launch": { - "local_path": "main.html" - } - }, + "background": { + "scripts": ["background.js"] + } + }, "icons": { "128": "chromoting128.webp", "48": "chromoting48.webp", "16": "chromoting16.webp" }, - "content_scripts": [ - { - "matches": [ - "OAUTH2_REDIRECT_URL" - ], - "js": [ "cs_oauth2_trampoline.js" ] - }, - { - "matches": [ - "THIRD_PARTY_AUTH_REDIRECT_URL" - ], - "js": [ "cs_third_party_auth_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", "optional_permissions": [ "" ], @@ -42,16 +28,20 @@ "clipboardRead", "clipboardWrite", - "nativeMessaging" + "nativeMessaging", + "experimental" ], - "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 } - ], + "oauth2": { + "client_id": "45833509441-oqgdhgddn085c7cq9djknefjo0tedtua.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 @@ -34,7 +34,6 @@ function consentRequired_(authContinue) { * Entry point for app initialization. */ remoting.init = function() { - migrateLocalToChromeStorage_(); remoting.logExtensionInfo_(); l10n.localize(); // Create global objects. @@ -45,10 +45,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(); @@ -156,9 +151,6 @@ remoting.initHomeScreenUi = function () { remoting.hostController = new remoting.HostController(); document.getElementById('share-button').disabled = !isIT2MeSupported_(); 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;