Commit e10b3bfb authored by Rachel Carpenter's avatar Rachel Carpenter Committed by Commit Bot

Add Help App CIPD resources to the resource bundle.

This means that we render the real app when ChromeOS,
and the mock html and JS when not (for testing).

Bug: 1012578, b/144121590
Change-Id: I282b39343c110da0482481f1569ad05a57e2f736
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1930360
Commit-Queue: Rachel Carpenter <carpenterr@google.com>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720848}
parent 20f60637
......@@ -164,6 +164,7 @@ template("chrome_extra_paks") {
"$root_gen_dir/chrome/cellular_setup_resources.pak",
"$root_gen_dir/chrome/multidevice_setup_resources.pak",
"$root_gen_dir/chrome/os_settings_resources.pak",
"$root_gen_dir/chromeos/chromeos_help_app_bundle_resources.pak",
"$root_gen_dir/chromeos/chromeos_help_app_resources.pak",
"$root_gen_dir/chromeos/chromeos_media_app_bundle_resources.pak",
"$root_gen_dir/chromeos/chromeos_media_app_resources.pak",
......@@ -178,6 +179,7 @@ template("chrome_extra_paks") {
"//chrome/browser/resources/chromeos:cellular_setup_resources",
"//chrome/browser/resources/chromeos:multidevice_setup_resources",
"//chromeos/resources",
"//chromeos/resources:help_app_bundle_resources",
"//chromeos/resources:help_app_resources",
"//chromeos/resources:media_app_bundle_resources",
"//chromeos/resources:media_app_resources",
......
......@@ -18,6 +18,7 @@ static_library("help_app_ui") {
deps = [
"//chromeos/constants",
"//chromeos/resources:help_app_bundle_resources",
"//chromeos/resources:help_app_resources",
"//content/public/browser",
"//ui/webui",
......
......@@ -5,6 +5,8 @@
#include "chromeos/components/help_app_ui/help_app_guest_ui.h"
#include "chromeos/components/help_app_ui/url_constants.h"
#include "chromeos/grit/chromeos_help_app_bundle_resources.h"
#include "chromeos/grit/chromeos_help_app_bundle_resources_map.h"
#include "chromeos/grit/chromeos_help_app_resources.h"
#include "content/public/browser/web_ui_data_source.h"
......@@ -15,7 +17,14 @@ content::WebUIDataSource* CreateHelpAppGuestDataSource() {
content::WebUIDataSource* source =
content::WebUIDataSource::Create(kChromeUIHelpAppGuestHost);
source->AddResourcePath("app.html", IDR_HELP_APP_APP_HTML);
source->AddResourcePath("js/bootstrap.js", IDR_HELP_APP_BOOTSTRAP_JS);
source->AddResourcePath("bootstrap.js", IDR_HELP_APP_BOOTSTRAP_JS);
// Add all resources from chromeos_media_app_bundle.pak.
for (size_t i = 0; i < kChromeosHelpAppBundleResourcesSize; i++) {
source->AddResourcePath(kChromeosHelpAppBundleResources[i].name,
kChromeosHelpAppBundleResources[i].value);
}
// TODO(crbug.com/1023700): Better solution before launch.
source->DisableDenyXFrameOptions();
return source;
......
......@@ -19,7 +19,7 @@ content::WebUIDataSource* CreateHostDataSource() {
// TODO(crbug.com/1012578): This is a placeholder only, update with the
// actual app content.
source->SetDefaultResource(IDR_HELP_APP_INDEX_HTML);
source->SetDefaultResource(IDR_HELP_APP_HOST_INDEX_HTML);
source->AddResourcePath("pwa.html", IDR_HELP_APP_PWA_HTML);
source->AddResourcePath("manifest.json", IDR_HELP_APP_MANIFEST);
source->AddResourcePath("app_icon_192.png", IDR_HELP_APP_ICON_192);
......
import("//build/config/chrome_build.gni")
declare_args() {
# Whether to enable the "real" ChromeOS Help App. When false, a mock app is
# bundled for testing integration points.
enable_cros_help_app = false
}
......@@ -2,11 +2,10 @@
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
margin: 0;
}
</style>
<script src="/js/bootstrap.js"></script>
<!-- TODO(crbug/1012578): Include scripts to run in the <iframe> sandbox that
communicate via postMessage to scripts running in index.html -->
<script src="/bootstrap.js"></script>
......@@ -13,19 +13,14 @@
<release seq="1">
<includes>
<!-- TODO(crbug.com/1012578): Add the run time resources .grdp here. -->
<include name="IDR_HELP_APP_APP_HTML" file="app.html"
type="BINDATA" />
<include name="IDR_HELP_APP_INDEX_HTML" file="index.html"
<include name="IDR_HELP_APP_APP_HTML" file="app.html" type="BINDATA" />
<include name="IDR_HELP_APP_HOST_INDEX_HTML" file="index.html"
type="BINDATA" />
<include name="IDR_HELP_APP_PWA_HTML" file="pwa.html" type="BINDATA" />
<include name="IDR_HELP_APP_MANIFEST" file="manifest.json"
type="BINDATA" />
<include name="IDR_HELP_APP_ICON_192" file="app_icon_192.png"
type="BINDATA" />
<include name="IDR_HELP_APP_BOOTSTRAP_JS"
file="js/bootstrap.js"
type="BINDATA" />
</includes>
</release>
</grit>
......@@ -2,4 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// TODO(crbug/1012578): Pull in resources for app correctly.
/**
* @fileoverview Placeholder js file for mock app.
*/
<?xml version="1.0" encoding="utf-8"?>
<grit current_release="1" latest_public_release="0" output_all_resource_defines="false">
<outputs>
<output filename="grit/chromeos_help_app_bundle_resources.h" type="rc_header">
<emit emit_type="prepend"/>
</output>
<output filename="grit/chromeos_help_app_bundle_resources_map.cc" type="resource_file_map_source"/>
<output filename="grit/chromeos_help_app_bundle_resources_map.h" type="resource_map_header"/>
<output filename="chromeos_help_app_bundle_resources.pak" type="data_package"/>
</outputs>
<release seq="1">
<includes>
<include name="IDR_HELP_APP_BOOTSTRAP_JS" file="bootstrap.js" type="BINDATA" />
</includes>
</release>
</grit>
......@@ -25,4 +25,4 @@
type="BINDATA" />
</includes>
</release>
</grit>
\ No newline at end of file
</grit>
......@@ -3,6 +3,7 @@
# found in the LICENSE file.
import("//chromeos/assistant/assistant.gni")
import("//chromeos/components/help_app_ui/help_app_ui.gni")
import("//chromeos/components/media_app_ui/media_app_ui.gni")
import("//tools/grit/grit_rule.gni")
......@@ -41,6 +42,8 @@ grit("resources") {
]
}
# Resources used by chrome://help-app, and parts of the sandboxed app it hosts
# that do not come from the app bundle (below).
grit("help_app_resources") {
source = "../components/help_app_ui/resources/help_app_resources.grd"
......@@ -55,8 +58,29 @@ grit("help_app_resources") {
output_dir = "$root_gen_dir/chromeos"
}
# Resources automatically served by the chrome://help-app bundle, obtained via DEPS.
grit("help_app_bundle_resources") {
if (enable_cros_help_app) {
# Obtained via src-internal/DEPS.
source =
"../components/help_app_ui/resources/app/help_app_bundle_resources.grd"
} else {
source = "../components/help_app_ui/resources/mock/help_app_bundle_mock_resources.grd"
}
source_is_generated = true
outputs = [
"grit/chromeos_help_app_bundle_resources.h",
"grit/chromeos_help_app_bundle_resources_map.cc",
"grit/chromeos_help_app_bundle_resources_map.h",
"chromeos_help_app_bundle_resources.pak",
]
output_dir = "$root_gen_dir/chromeos"
}
# Resources used by chrome://media-app, and parts of the sandboxed app it hosts
# that do no come from the app bundle (below).
# that do not come from the app bundle (below).
grit("media_app_resources") {
source = "../components/media_app_ui/resources/media_app_resources.grd"
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment