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

Unified Diff: remoting/webapp/appsv2.patch

Issue 11769002: Apps v2 identity integration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed identity.js from html. Fixed patch. Created 7 years, 12 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 | « no previous file | remoting/webapp/background.js » ('j') | remoting/webapp/host_screen.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/appsv2.patch
diff --git a/remoting/webapp/appsv2.patch b/remoting/webapp/appsv2.patch
new file mode 100644
index 0000000000000000000000000000000000000000..294ccd9581f04d024f890d39ac05d6953e67e878
--- /dev/null
+++ b/remoting/webapp/appsv2.patch
@@ -0,0 +1,183 @@
+diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
+index 2f7a7f0..57d1a57 100644
+--- a/remoting/remoting.gyp
++++ b/remoting/remoting.gyp
+@@ -154,6 +154,7 @@
+ 'webapp/toolbar.css',
+ ],
+ 'remoting_webapp_js_files': [
++ 'webapp/background.js',
+ 'webapp/client_plugin.js',
+ 'webapp/client_plugin_async.js',
+ 'webapp/client_screen.js',
+@@ -170,6 +171,7 @@
+ 'webapp/host_session.js',
+ 'webapp/host_setup_dialog.js',
+ 'webapp/host_table_entry.js',
++ 'webapp/identity.js',
+ 'webapp/l10n.js',
+ 'webapp/log_to_server.js',
+ 'webapp/menu_button.js',
+diff --git a/remoting/webapp/client_session.js b/remoting/webapp/client_session.js
+index 5659a77..fd727d1 100644
+--- a/remoting/webapp/client_session.js
++++ b/remoting/webapp/client_session.js
+@@ -206,7 +206,7 @@ remoting.ClientSession.prototype.createClientPlugin_ = function(container, id) {
+ document.createElement('embed');
+
+ plugin.id = id;
+- plugin.src = 'about://none';
++ plugin.src = '';
+ plugin.type = 'application/vnd.chromium.remoting-viewer';
+ plugin.width = 0;
+ plugin.height = 0;
+diff --git b/remoting/webapp/event_handlers.js a/remoting/webapp/event_handlers.js
+index f3a8c24..63cd14c 100644
+--- a/remoting/webapp/event_handlers.js
++++ b/remoting/webapp/event_handlers.js
+@@ -62,7 +62,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 },
+@@ -124,6 +123,6 @@ function onBeforeUnload() {
+ }
+
+ window.addEventListener('load', onLoad, false);
+-window.addEventListener('beforeunload', onBeforeUnload, false);
++//window.addEventListener('beforeunload', onBeforeUnload, false);
+ window.addEventListener('resize', remoting.onResize, false);
+-window.addEventListener('unload', remoting.disconnect, false);
++//window.addEventListener('unload', remoting.disconnect, false);
+diff --git b/remoting/webapp/host_controller.js a/remoting/webapp/host_controller.js
+index 5f04bce..517696d 100644
+--- b/remoting/webapp/host_controller.js
++++ a/remoting/webapp/host_controller.js
+@@ -310,7 +310,7 @@ remoting.HostController.prototype.getLocalHostStateAndId = function(onDone) {
+ onDone(state, that.localHostId_);
+ };
+ try {
+- this.plugin_.getDaemonConfig(onConfig);
++ onConfig('{}'); // this.plugin_.getDaemonConfig(onConfig);
+ } catch (err) {
+ onDone(remoting.HostController.State.NOT_IMPLEMENTED, null);
+ }
+diff --git b/remoting/webapp/identity.js a/remoting/webapp/identity.js
+index 3734bc6..30b85a3 100644
+--- b/remoting/webapp/identity.js
++++ a/remoting/webapp/identity.js
+@@ -12,12 +12,7 @@
+ /** @suppress {duplicate} */
+ var remoting = remoting || {};
+
+-/**
+- * TODO(jamiewalch): Remove the remoting.OAuth2 possibility when the Apps v2
+- * work is complete.
+- *
+- * @type {remoting.Identity|remoting.OAuth2}
+- */
++/** @type {remoting.Identity} */
+ remoting.identity = null;
+
+
+--- a/remoting/webapp/manifest.json
++++ b/remoting/webapp/manifest.json
+@@ -2,28 +2,22 @@
+ "name": "__MSG_PRODUCT_NAME__",
+ "version": "FULL_APP_VERSION",
+ "description": "__MSG_PRODUCT_DESCRIPTION__",
+- "manifest_version": 2,
+ "default_locale": "en",
+- "app": {
+- "launch": {
+- "local_path": "main.html"
++ "manifest_version": 2,
++ "app" : {
++ "background": {
++ "scripts": ["background.js"]
+ }
+ },
++ "key": "chromotingappsv2",
+ "icons": {
+ "128": "chromoting128.png",
+ "48": "chromoting48.png",
+ "16": "chromoting16.png"
+ },
+- "content_scripts": [
+- {
+- "matches": [
+- "OAUTH2_REDIRECT_URL"
+- ],
+- "js": [ "cs_oauth2_trampoline.js" ]
+- }
+- ],
+- "content_security_policy": "default-src 'self'; script-src 'self' https://*.talkgadget.google.com; style-src 'self' https://fonts.googleapis.com; img-src 'self' https://*.talkgadget.google.com; font-src *; connect-src 'self' https://accounts.google.com https://www.googleapis.com https://*.talkgadget.google.com https://relay.google.com",
+ "permissions": [
++ "experimental",
++ "storage",
+ "https://accounts.google.com/*",
+ "https://www.googleapis.com/chromoting/*",
+ "https://*.talkgadget.google.com/talkgadget/*",
+@@ -31,12 +25,12 @@
+ "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 }
+- ],
++ "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
+diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
+index a8ab35b..9c6df35 100644
+--- a/remoting/webapp/remoting.js
++++ b/remoting/webapp/remoting.js
+@@ -39,11 +47,9 @@ remoting.init = function() {
+ l10n.localize();
+ // Create global objects.
+ remoting.oauth2 = new remoting.OAuth2();
+- // TODO(jamiewalch): Reinstate this when we migrate to apps v2.
+- // remoting.identity = new remoting.Identity(
+- // document.getElementById('auth-dialog'),
+- // document.getElementById('auth-button'));
+- remoting.identity = remoting.oauth2;
++ remoting.identity = new remoting.Identity(
++ document.getElementById('auth-dialog'),
++ document.getElementById('auth-button'));
+ remoting.stats = new remoting.ConnectionStats(
+ document.getElementById('statistics'));
+ remoting.formatIq = new remoting.FormatIq();
+@@ -119,9 +126,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 b/remoting/webapp/main.html a/remoting/webapp/main.html
+index 1a45c86..113403a 100644
+--- b/remoting/webapp/main.html
++++ a/remoting/webapp/main.html
+@@ -31,6 +31,7 @@ found in the LICENSE file.
+ <script src="host_screen.js"></script>
+ <script src="host_session.js"></script>
+ <script src="host_table_entry.js"></script>
++ <script src="identity.js"></script>
+ <script src="l10n.js"></script>
+ <script src="log_to_server.js"></script>
+ <script src="menu_button.js"></script>
« no previous file with comments | « no previous file | remoting/webapp/background.js » ('j') | remoting/webapp/host_screen.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698