diff --git a/remoting/app_remoting_shared_module.gyp b/remoting/app_remoting_shared_module.gyp new file mode 100644 index 00000000000000..459e610593c4f5 --- /dev/null +++ b/remoting/app_remoting_shared_module.gyp @@ -0,0 +1,215 @@ +# Copyright 2015 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'includes': [ + 'remoting_version.gypi', + 'remoting_locales.gypi', + 'remoting_options.gypi', + 'remoting_webapp_files.gypi', + 'app_remoting_webapp_files.gypi', + ], + 'targets': [ + { + # GN version: //remoting/webapp:ar_shared_module + 'target_name': 'ar_shared_module', + 'type': 'none', + + + 'variables': { + 'app_key': 'Sample_App', + 'app_id': 'ljacajndfccfgnfohlgkdphmbnpkjflk', + 'app_client_id': 'sample_client_id', + 'app_name': 'App Remoting Client', + 'app_description': 'App Remoting client', + + 'ar_shared_module_manifest': 'webapp/app_remoting/shared_module/manifest.json', + + 'ar_generated_html_files': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', + '<(SHARED_INTERMEDIATE_DIR)/remoting/credits.html', + ], + 'ar_shared_module_files': [ + '<@(ar_shared_resource_files)', + '<@(ar_all_js_files)', + '<@(ar_generated_html_files)', + ], + 'output_dir': '<(PRODUCT_DIR)/app_streaming/>(_target_name)', + 'zip_path': '<(PRODUCT_DIR)/app_streaming/>(_target_name).zip', + + 'ar_shared_module_locales_listfile': '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)_locales.txt', + + }, + + + 'actions': [ + { + 'action_name': 'Build ar_shared_module locales listfile', + 'inputs': [ + '<(remoting_localize_path)', + ], + 'outputs': [ + '<(ar_shared_module_locales_listfile)', + ], + 'action': [ + 'python', '<(remoting_localize_path)', + '--locale_output', + '"<(webapp_locale_dir)/@{json_suffix}/messages.json"', + '--locales_listfile', + '<(ar_shared_module_locales_listfile)', + '<@(remoting_locales)', + ], + }, + { + 'action_name': 'Build ar_shared_module application stub', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-webapp.py', + '<(chrome_version_path)', + '<(remoting_version_path)', + '<@(ar_shared_module_files)', + '<@(remoting_webapp_locale_files)', + '<(ar_shared_module_manifest)', + '<(ar_shared_module_locales_listfile)', + ], + 'outputs': [ + '<(output_dir)', + '<(zip_path)', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-webapp.py', + '<(buildtype)', + '<(version_full)', + '<(output_dir)', + '<(zip_path)', + '<(ar_shared_module_manifest)', + 'shared_module', # Web app type + '<@(ar_shared_module_files)', + '--locales_listfile', + '<(ar_shared_module_locales_listfile)', + ], + }, + + { + 'action_name': 'Build ar_shared_module main.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(ar_main_template)', + '<@(ar_main_template_files)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', + '<(ar_main_template)', + '--template-dir', + '<(DEPTH)/remoting', + '--templates', + '<@(ar_main_template_files)', + '--js', + '<@(ar_main_js_files)', + ], + }, + { + 'action_name': 'Build ar_shared_module ar_background.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(ar_background_template)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/ar_background.html', + '<(ar_background_template)', + '--template-dir', + '<(DEPTH)/remoting', + '--js', + '<@(ar_background_html_js_files)', + ], + }, + { + 'action_name': 'Build ar_shared_module wcs_sandbox.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(remoting_webapp_template_wcs_sandbox)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', + '<(remoting_webapp_template_wcs_sandbox)', + '--js', + '<@(remoting_webapp_wcs_sandbox_html_all_js_files)', + ], + }, + { + 'action_name': 'Build ar_shared_module loading_window.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(ar_loading_window_template)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', + '<(ar_loading_window_template)', + # The loading window is just a reskin of the message window--all + # JS code is shared. + '--js', '<@(remoting_webapp_message_window_html_all_js_files)', + ], + }, + { + 'action_name': 'Build ar_shared_module message_window.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(remoting_webapp_template_message_window)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', + '<(remoting_webapp_template_message_window)', + '--js', '<@(remoting_webapp_message_window_html_all_js_files)', + ], + }, + { + 'action_name': 'Build ar_shared_module feedback_consent.html', + 'inputs': [ + '<(DEPTH)/remoting/webapp/build-html.py', + '<(ar_feedback_consent_template)', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', + ], + 'action': [ + 'python', '<(DEPTH)/remoting/webapp/build-html.py', + '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', + '<(ar_feedback_consent_template)', + '--template-dir', + '<(DEPTH)/remoting', + '--js', + '<@(ar_feedback_consent_html_all_js_files)', + ], + }, + ], # actions + + + }, # end of ar_shared_module + + ], # end of targets +} diff --git a/remoting/app_remoting_webapp_build.gypi b/remoting/app_remoting_webapp_build.gypi index 9117e4f5efbf36..01886d04283cd8 100644 --- a/remoting/app_remoting_webapp_build.gypi +++ b/remoting/app_remoting_webapp_build.gypi @@ -40,19 +40,10 @@ '>(ar_app_path)/icon128.png', '>(ar_app_path)/loading_splash.png', ], - 'ar_generated_html_files': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', - '<(SHARED_INTERMEDIATE_DIR)/remoting/credits.html', - ], 'ar_webapp_files': [ '<@(ar_app_specific_files)', - '<@(ar_shared_resource_files)', - '<@(ar_all_js_files)', - '<@(ar_generated_html_files)', + '<@(ar_vendor_js_files)', + '<@(ar_vendor_html_files)', ], 'output_dir': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name)', 'zip_path': '<(PRODUCT_DIR)/app_streaming/<@(ar_service_environment)/>(_target_name).zip', @@ -103,7 +94,6 @@ '<(remoting_version_path)', '<@(ar_webapp_files)', '<@(remoting_webapp_locale_files)', - '<@(ar_generated_html_files)', '<(ar_app_manifest_app)', '<(DEPTH)/remoting/<(ar_app_manifest_common)', '<(ar_webapp_locales_listfile)', @@ -140,98 +130,6 @@ '>@(_app_client_id)', ], }, - { - 'action_name': 'Build ">(ar_app_name)" main.html', - 'inputs': [ - '<(DEPTH)/remoting/webapp/build-html.py', - '<(ar_main_template)', - '<@(ar_main_template_files)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', - ], - 'action': [ - 'python', '<(DEPTH)/remoting/webapp/build-html.py', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/main.html', - '<(ar_main_template)', - '--template-dir', - '<(DEPTH)/remoting', - '--templates', - '<@(ar_main_template_files)', - '--js', - '<@(ar_main_js_files)', - ], - }, - { - 'action_name': 'Build ">(ar_app_name)" wcs_sandbox.html', - 'inputs': [ - '<(DEPTH)/remoting/webapp/build-html.py', - '<(remoting_webapp_template_wcs_sandbox)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', - ], - 'action': [ - 'python', '<(DEPTH)/remoting/webapp/build-html.py', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/wcs_sandbox.html', - '<(remoting_webapp_template_wcs_sandbox)', - '--js', - '<@(remoting_webapp_wcs_sandbox_html_all_js_files)', - ], - }, - { - 'action_name': 'Build ">(ar_app_name)" loading_window.html', - 'inputs': [ - '<(DEPTH)/remoting/webapp/build-html.py', - '<(ar_loading_window_template)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', - ], - 'action': [ - 'python', '<(DEPTH)/remoting/webapp/build-html.py', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/loading_window.html', - '<(ar_loading_window_template)', - # The loading window is just a reskin of the message window--all - # JS code is shared. - '--js', '<@(remoting_webapp_message_window_html_all_js_files)', - ], - }, - { - 'action_name': 'Build ">(ar_app_name)" message_window.html', - 'inputs': [ - '<(DEPTH)/remoting/webapp/build-html.py', - '<(remoting_webapp_template_message_window)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', - ], - 'action': [ - 'python', '<(DEPTH)/remoting/webapp/build-html.py', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/message_window.html', - '<(remoting_webapp_template_message_window)', - '--js', '<@(remoting_webapp_message_window_html_all_js_files)', - ], - }, - { - 'action_name': 'Build ">(ar_app_name)" feedback_consent.html', - 'inputs': [ - '<(DEPTH)/remoting/webapp/build-html.py', - '<(ar_feedback_consent_template)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', - ], - 'action': [ - 'python', '<(DEPTH)/remoting/webapp/build-html.py', - '<(SHARED_INTERMEDIATE_DIR)/>(_target_name)/feedback_consent.html', - '<(ar_feedback_consent_template)', - '--template-dir', - '<(DEPTH)/remoting', - '--js', - '<@(ar_feedback_consent_html_all_js_files)', - ], - }, ], # actions 'conditions': [ ['buildtype == "Dev"', { diff --git a/remoting/app_remoting_webapp_compile.gypi b/remoting/app_remoting_webapp_compile.gypi index 4cc36d9f2aa02c..40946b5c604c01 100644 --- a/remoting/app_remoting_webapp_compile.gypi +++ b/remoting/app_remoting_webapp_compile.gypi @@ -23,7 +23,7 @@ 'target_name': 'verify_background.js', 'variables': { 'source_files': [ - '<@(ar_background_js_files)', + '<@(ar_background_html_js_files)', '<@(remoting_webapp_js_proto_files)', ], 'out_file': '<(PRODUCT_DIR)/>(_target_name)_background_jscompile.stamp', @@ -42,4 +42,4 @@ 'includes': ['compile_js.gypi'], }, ], # targets -} \ No newline at end of file +} diff --git a/remoting/app_remoting_webapp_files.gypi b/remoting/app_remoting_webapp_files.gypi index 211593eb498f66..a4a25e7feafb98 100644 --- a/remoting/app_remoting_webapp_files.gypi +++ b/remoting/app_remoting_webapp_files.gypi @@ -57,7 +57,6 @@ 'webapp/app_remoting/js/app_remoting.js', 'webapp/app_remoting/js/app_remoting_activity.js', 'webapp/app_remoting/js/ar_auth_dialog.js', - 'webapp/app_remoting/js/ar_main.js', 'webapp/app_remoting/js/context_menu_adapter.js', 'webapp/app_remoting/js/context_menu_chrome.js', 'webapp/app_remoting/js/context_menu_dom.js', @@ -69,8 +68,6 @@ 'webapp/app_remoting/js/loading_window.js', 'webapp/app_remoting/js/submenu_manager.js', 'webapp/app_remoting/js/window_activation_menu.js', - 'webapp/base/js/application.js', - 'webapp/base/js/base.js', 'webapp/base/js/message_window_helper.js', 'webapp/base/js/message_window_manager.js', '<@(remoting_webapp_shared_js_auth_google_files)', @@ -82,18 +79,30 @@ '<@(remoting_webapp_shared_js_ui_files)', ], - 'ar_background_js_files': [ + # Variables for ar_background.html. + 'ar_background_template': + '<(DEPTH)/remoting/webapp/app_remoting/html/template_background.html', + 'ar_background_html_js_files': [ 'webapp/app_remoting/js/ar_background.js', 'webapp/base/js/platform.js', ], + 'ar_vendor_js_files': [ + 'webapp/app_remoting/vendor/arv_main.js', + ], + + 'ar_vendor_html_files': [ + 'webapp/app_remoting/vendor/arv_background.html', + 'webapp/app_remoting/vendor/arv_main.html', + 'webapp/app_remoting/vendor/arv_wcs_sandbox.html', + ], + 'ar_all_js_files': [ '<@(ar_main_js_files)', '<@(ar_feedback_consent_html_js_files)', '<@(remoting_webapp_message_window_html_js_files)', '<@(remoting_webapp_wcs_sandbox_html_js_files)', - # Referenced from the manifest. - '<@(ar_background_js_files)', + '<@(ar_background_html_js_files)', 'webapp/base/js/credits_js.js', ], diff --git a/remoting/remoting_all.gyp b/remoting/remoting_all.gyp index 2451f151a0b056..70adde6472da5a 100644 --- a/remoting/remoting_all.gyp +++ b/remoting/remoting_all.gyp @@ -13,6 +13,7 @@ 'type': 'none', 'dependencies': [ '../remoting/app_remoting_webapp.gyp:ar_sample_app', + '../remoting/app_remoting_shared_module.gyp:ar_shared_module', '../remoting/remoting.gyp:ar_sample_test_driver', '../remoting/remoting.gyp:chromoting_test_driver', '../remoting/remoting.gyp:remoting_base', diff --git a/remoting/remoting_options.gni b/remoting/remoting_options.gni index df1292f4f3a582..6c1c7a10740356 100644 --- a/remoting/remoting_options.gni +++ b/remoting/remoting_options.gni @@ -11,6 +11,9 @@ declare_args() { # Set this to enable cast mode on the android client. enable_cast = 0 +# Set this to enable building internal AppRemoting apps. +enable_internal_app_remoting_targets = false + # Set this to use GCD instead of the remoting directory service. remoting_use_gcd = 0 diff --git a/remoting/remoting_webapp_files.gypi b/remoting/remoting_webapp_files.gypi index c7e1fdf354f169..3b0cb9f8cf9173 100644 --- a/remoting/remoting_webapp_files.gypi +++ b/remoting/remoting_webapp_files.gypi @@ -178,7 +178,6 @@ ], # Remoting core JavaScript files. 'remoting_webapp_shared_js_core_files': [ - 'webapp/base/js/app_capabilities.js', 'webapp/base/js/application.js', 'webapp/base/js/base.js', 'webapp/base/js/ipc.js', diff --git a/remoting/webapp/BUILD.gn b/remoting/webapp/BUILD.gn index 34d90e0c4cafb2..a152052af23c9d 100644 --- a/remoting/webapp/BUILD.gn +++ b/remoting/webapp/BUILD.gn @@ -12,13 +12,42 @@ group("webapp") { ":webapp_v1", ":ar_sample_app", ":credits", + ":ar_shared_module", ] + if (enable_internal_app_remoting_targets) { + deps += [ "//remoting/internal:ar_internal_apps" ] + } + if (enable_nacl) { deps += [ ":webapp_v2" ] } } +# GYP version: remoting/remoting_client:remoting_credits +action("credits") { + about_credits_file = "$target_gen_dir/credits.html" + script = "//tools/licenses.py" + + inputs = [ + "base/html/credits.tmpl", + "base/html/credits_entry.tmpl", + ] + + outputs = [ + about_credits_file, + ] + + args = [ + "credits", + rebase_path(about_credits_file, root_build_dir), + "--file-template", + rebase_path("base/html/credits.tmpl", root_build_dir), + "--entry-template", + rebase_path("base/html/credits_entry.tmpl", root_build_dir), + ] +} + desktop_remoting_webapp("webapp_v1") { webapp_type = "v1" output_dir = "remoting/remoting-webapp" @@ -41,32 +70,15 @@ app_remoting_webapp("ar_sample_app") { app_key = "Sample_App" app_id = "ljacajndfccfgnfohlgkdphmbnpkjflk" app_client_id = "sample_client_id" - app_name = "App Remoting Client" + app_vendor = "" + app_name = "sample_app" + app_fullname = "App Remoting Client" app_description = "App Remoting client" app_capabilities = [ "GOOGLE_DRIVE" ] manifest_key = "remotingdevbuild" } -# GYP version: remoting/remoting_client:remoting_client_credits -action("credits") { - about_credits_file = "$target_gen_dir/credits.html" - script = "//tools/licenses.py" - - inputs = [ - "base/html/credits.tmpl", - "base/html/credits_entry.tmpl", - ] - - outputs = [ - about_credits_file, - ] - - args = [ - "credits", - rebase_path(about_credits_file, root_build_dir), - "--file-template", - rebase_path("base/html/credits.tmpl", root_build_dir), - "--entry-template", - rebase_path("base/html/credits_entry.tmpl", root_build_dir), - ] +app_remoting_shared_module("ar_shared_module") { + #app_client_id = "sample_client_id" + app_name = "shared_module" } diff --git a/remoting/webapp/app_remoting/html/context_menu.html b/remoting/webapp/app_remoting/html/context_menu.html index ebc056ebc79e82..010c86d89789df 100644 --- a/remoting/webapp/app_remoting/html/context_menu.html +++ b/remoting/webapp/app_remoting/html/context_menu.html @@ -6,7 +6,7 @@