1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
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/host_controller.js b/remoting/webapp/host_controller.js
index 83c9844..98f63c3 100644
--- a/host_controller.js
+++ b/host_controller.js
@@ -356,7 +356,7 @@ remoting.HostController.prototype.getLocalHostStateAndId = function(onDone) {
onDone(hostId);
};
try {
- this.plugin_.getDaemonConfig(onConfig);
+ onConfig('{}');
} catch (err) {
onDone(null);
}
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.
<script src="host_settings.js"></script>
<script src="host_setup_dialog.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>
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,18 +22,22 @@
"TALK_GADGET_HOST/talkgadget/*",
"https://relay.google.com/*",
"storage",
"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"
],
+ "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
@@ -34,8 +34,6 @@ function consentRequired_(authContinue) {
* Entry point for app initialization.
*/
remoting.init = function() {
- migrateLocalToChromeStorage_();
-
// TODO(jamiewalch): Remove this when we migrate to apps v2
// (http://crbug.com/ 134213).
remoting.initMockStorage();
@@ -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();
@@ -133,9 +130,6 @@ remoting.initHomeScreenUi = 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;
|