Use a consistent extension id for unofficial builds.
[chromium-blink-merge.git] / remoting / webapp / appsv2.patch
blob4b2aed203f813209d2db290f99b8b2614c58d316
1 diff --git a/remoting/webapp/event_handlers.js b/remoting/webapp/event_handlers.js
2 index 5dfc368..f69d984 100644
3 --- a/event_handlers.js
4 +++ b/event_handlers.js
5 @@ -54,7 +54,6 @@ function onLoad() {
6 fn: remoting.sendCtrlAltDel },
7 { event: 'click', id: 'send-print-screen',
8 fn: remoting.sendPrintScreen },
9 - { event: 'click', id: 'auth-button', fn: doAuthRedirect },
10 { event: 'click', id: 'share-button', fn: remoting.tryShare },
11 { event: 'click', id: 'access-mode-button', fn: goEnterAccessCode },
12 { event: 'click', id: 'cancel-share-button', fn: remoting.cancelShare },
13 @@ -104,6 +103,4 @@ function onBeforeUnload() {
16 window.addEventListener('load', onLoad, false);
17 -window.addEventListener('beforeunload', onBeforeUnload, false);
18 window.addEventListener('resize', remoting.onResize, false);
19 -window.addEventListener('unload', remoting.disconnect, false);
20 diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js
21 index 83c9844..98f63c3 100644
22 --- a/host_controller.js
23 +++ b/host_controller.js
24 @@ -31,7 +31,7 @@ remoting.HostController.prototype.getLocalHostStateAndId = function(onDone) {
27 try {
28 - this.hostDispatcher_.getDaemonVersion(printVersion);
29 + onConfig('{}');
30 } catch (err) {
31 console.log('Host version not available.');
33 diff --git a/remoting/webapp/main.html b/remoting/webapp/main.html
34 index 061caeb..f61e532 100644
35 --- a/main.html
36 +++ b/main.html
37 @@ -35,6 +35,7 @@ found in the LICENSE file.
38 <script src="host_settings.js"></script>
39 <script src="host_setup_dialog.js"></script>
40 <script src="host_table_entry.js"></script>
41 + <script src="identity.js"></script>
42 <script src="l10n.js"></script>
43 <script src="log_to_server.js"></script>
44 <script src="menu_button.js"></script>
45 diff --git a/remoting/webapp/manifest.json b/remoting/webapp/manifest.json
46 index d1f8d1f..67bf660 100644
47 --- a/manifest.json
48 +++ b/manifest.json
49 @@ -5,30 +5,15 @@
50 "manifest_version": 2,
51 "default_locale": "en",
52 "app": {
53 - "launch": {
54 - "local_path": "main.html"
55 - }
56 - },
57 + "background": {
58 + "scripts": ["background.js"]
59 + }
60 + },
61 "icons": {
62 "128": "chromoting128.webp",
63 "48": "chromoting48.webp",
64 "16": "chromoting16.webp"
66 - "content_scripts": [
67 - {
68 - "matches": [
69 - "OAUTH2_REDIRECT_URL"
70 - ],
71 - "js": [ "cs_oauth2_trampoline.js" ]
72 - },
73 - {
74 - "matches": [
75 - "THIRD_PARTY_AUTH_REDIRECT_URL"
76 - ],
77 - "js": [ "cs_third_party_auth_trampoline.js" ]
78 - }
79 - ],
80 - "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",
81 "optional_permissions": [
82 "<all_urls>"
84 @@ -41,16 +27,20 @@
85 "storage",
86 "clipboardRead",
87 - "clipboardWrite"
88 + "clipboardWrite",
89 + "experimental"
91 - "plugins": [
92 - { "path": "remoting_host_plugin.dll", "public": false },
93 - { "path": "libremoting_host_plugin.ia32.so", "public": false },
94 - { "path": "libremoting_host_plugin.x64.so", "public": false },
95 - { "path": "remoting_host_plugin.plugin", "public": false }
96 - ],
97 + "oauth2": {
98 + "client_id": "45833509441-oqgdhgddn085c7cq9djknefjo0tedtua.apps.googleusercontent.com",
99 + "scopes": [
100 + "https://www.googleapis.com/auth/chromoting https://www.googleapis.com/auth/googletalk https://www.googleapis.com/auth/userinfo#email"
102 + },
103 "requirements": {
104 "plugins": {
105 "npapi": false
107 + },
108 + "sandbox": {
109 + "pages": [ "wcs_sandbox.html" ]
112 diff --git a/remoting/webapp/remoting.js b/remoting/webapp/remoting.js
113 index f89072a..2fadd83 100644
114 --- a/remoting.js
115 +++ b/remoting.js
116 @@ -34,8 +34,6 @@ function consentRequired_(authContinue) {
117 * Entry point for app initialization.
119 remoting.init = function() {
120 - migrateLocalToChromeStorage_();
122 // TODO(jamiewalch): Remove this when we migrate to apps v2
123 // (http://crbug.com/ 134213).
124 remoting.initMockStorage();
125 @@ -45,10 +45,7 @@ remoting.init = function() {
126 // Create global objects.
127 remoting.settings = new remoting.Settings();
128 remoting.oauth2 = new remoting.OAuth2();
129 - // TODO(jamiewalch): Reinstate this when we migrate to apps v2
130 - // (http://crbug.com/ 134213).
131 - // remoting.identity = new remoting.Identity(consentRequired_);
132 - remoting.identity = remoting.oauth2;
133 + remoting.identity = new remoting.Identity(consentRequired_);
134 remoting.stats = new remoting.ConnectionStats(
135 document.getElementById('statistics'));
136 remoting.formatIq = new remoting.FormatIq();
137 @@ -156,9 +151,6 @@ remoting.initHomeScreenUi = function () {
138 remoting.hostController = new remoting.HostController();
139 document.getElementById('share-button').disabled = !isIT2MeSupported_();
140 remoting.setMode(remoting.AppMode.HOME);
141 - if (!remoting.oauth2.isAuthenticated()) {
142 - document.getElementById('auth-dialog').hidden = false;
144 remoting.hostSetupDialog =
145 new remoting.HostSetupDialog(remoting.hostController);
146 // Display the cached host list, then asynchronously update and re-display it.
147 diff --git a/remoting/webapp/xhr_proxy.js b/remoting/webapp/xhr_proxy.js
148 index 4c45780..653b481 100644
149 --- a/xhr_proxy.js
150 +++ b/xhr_proxy.js
151 @@ -90,4 +90,4 @@ remoting.XMLHttpRequestProxy.prototype.DONE = 4;
153 // Since the WCS driver code constructs XHRs directly, the only mechanism for
154 // proxying them is to replace the XMLHttpRequest constructor.
155 -//XMLHttpRequest = remoting.XMLHttpRequestProxy;
156 +XMLHttpRequest = remoting.XMLHttpRequestProxy;