OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Creates a directory with with the unpacked contents of the remoting webapp. | 6 """Creates a directory with with the unpacked contents of the remoting webapp. |
7 | 7 |
8 The directory will contain a copy-of or a link-to to all remoting webapp | 8 The directory will contain a copy-of or a link-to to all remoting webapp |
9 resources. This includes HTML/JS and any plugin binaries. The script also | 9 resources. This includes HTML/JS and any plugin binaries. The script also |
10 massages resulting files appropriately with host plugin data. Finally, | 10 massages resulting files appropriately with host plugin data. Finally, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 # Strip the linux build. | 182 # Strip the linux build. |
183 if ((platform.system() == 'Linux') and (buildtype == 'Official')): | 183 if ((platform.system() == 'Linux') and (buildtype == 'Official')): |
184 subprocess.call(["strip", newPluginPath]) | 184 subprocess.call(["strip", newPluginPath]) |
185 | 185 |
186 # Set the correct mimetype. | 186 # Set the correct mimetype. |
187 hostPluginMimeType = os.environ.get( | 187 hostPluginMimeType = os.environ.get( |
188 'HOST_PLUGIN_MIMETYPE', 'application/vnd.chromium.remoting-host') | 188 'HOST_PLUGIN_MIMETYPE', 'application/vnd.chromium.remoting-host') |
189 findAndReplace(os.path.join(destination, 'plugin_settings.js'), | 189 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
190 'HOST_PLUGIN_MIMETYPE', hostPluginMimeType) | 190 'HOST_PLUGIN_MIMETYPE', hostPluginMimeType) |
191 | 191 |
| 192 # Set client plugin type. |
| 193 client_plugin = 'pnacl' if webapp_type == 'v2_pnacl' else 'native' |
| 194 findAndReplace(os.path.join(destination, 'plugin_settings.js'), |
| 195 "'CLIENT_PLUGIN_TYPE'", "'" + client_plugin + "'") |
| 196 |
192 # Allow host names for google services/apis to be overriden via env vars. | 197 # Allow host names for google services/apis to be overriden via env vars. |
193 oauth2AccountsHost = os.environ.get( | 198 oauth2AccountsHost = os.environ.get( |
194 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') | 199 'OAUTH2_ACCOUNTS_HOST', 'https://accounts.google.com') |
195 oauth2ApiHost = os.environ.get( | 200 oauth2ApiHost = os.environ.get( |
196 'OAUTH2_API_HOST', 'https://www.googleapis.com') | 201 'OAUTH2_API_HOST', 'https://www.googleapis.com') |
197 directoryApiHost = os.environ.get( | 202 directoryApiHost = os.environ.get( |
198 'DIRECTORY_API_HOST', 'https://www.googleapis.com') | 203 'DIRECTORY_API_HOST', 'https://www.googleapis.com') |
199 oauth2BaseUrl = oauth2AccountsHost + '/o/oauth2' | 204 oauth2BaseUrl = oauth2AccountsHost + '/o/oauth2' |
200 oauth2ApiBaseUrl = oauth2ApiHost + '/oauth2' | 205 oauth2ApiBaseUrl = oauth2ApiHost + '/oauth2' |
201 directoryApiBaseUrl = directoryApiHost + '/chromoting/v1' | 206 directoryApiBaseUrl = directoryApiHost + '/chromoting/v1' |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 else: | 324 else: |
320 files.append(arg) | 325 files.append(arg) |
321 | 326 |
322 return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], | 327 return buildWebApp(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], |
323 sys.argv[5], sys.argv[6], sys.argv[7], plugin, | 328 sys.argv[5], sys.argv[6], sys.argv[7], plugin, |
324 files, locales) | 329 files, locales) |
325 | 330 |
326 | 331 |
327 if __name__ == '__main__': | 332 if __name__ == '__main__': |
328 sys.exit(main()) | 333 sys.exit(main()) |
OLD | NEW |