Commit 5da231b7 authored by Bruno Santos's avatar Bruno Santos Committed by Commit Bot

Use internal Kiosk Next Home files.

When available, use internal version of main.html and resources file.

Bug: 957205
Change-Id: I3d7c7f381bf42e51685d553f90fe0d4c994fc1ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1590646Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Commit-Queue: Bruno Santos <brunoad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656355}
parent 5c7c395b
......@@ -4,6 +4,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//chrome/browser/chromeos/kiosk_next_home/kiosk_next.gni")
import("//extensions/buildflags/buildflags.gni")
import("//media/media_options.gni")
import("//printing/buildflags/buildflags.gni")
......@@ -44,6 +45,11 @@ source_set("chromeos") {
"//ui/strings",
]
if (enable_kiosk_next && is_chrome_branded) {
public_deps +=
[ "//chrome/browser/resources:kiosk_next_internal_resources" ]
}
deps = [
":attestation_proto",
":backdrop_wallpaper_proto",
......
......@@ -19,7 +19,7 @@
#include "url/url_constants.h"
#if defined(GOOGLE_CHROME_BUILD)
#include "chrome/grit/component_extension_resources.h"
#include "chrome/grit/kiosk_next_internal_resources.h"
#include "ui/base/resource/resource_bundle.h"
#endif
......
......@@ -756,10 +756,6 @@ jumbo_static_library("extensions") {
]
defines = []
if (is_chromeos && enable_kiosk_next) {
defines += [ "KIOSK_NEXT" ]
}
allow_circular_includes_from = [
# Lots of APIs use headers from the list above.
"//chrome/browser/extensions/api:api_registration",
......@@ -982,7 +978,6 @@ jumbo_static_library("extensions") {
}
deps += [
"//ash/public/cpp",
"//chrome/browser/chromeos/kiosk_next_home/mojom",
"//chrome/browser/resources/chromeos/camera:chrome_camera_app",
"//chromeos",
"//chromeos/attestation",
......@@ -1021,6 +1016,13 @@ jumbo_static_library("extensions") {
"//ui/ozone",
"//ui/views",
]
if (enable_kiosk_next) {
defines += [ "KIOSK_NEXT" ]
deps += [ "//chrome/browser/chromeos/kiosk_next_home/mojom" ]
if (is_chrome_branded) {
deps += [ "//chrome/browser/resources:kiosk_next_internal_resources" ]
}
}
if (enable_nacl) {
deps += [ "//chrome/browser/resources/chromeos/zip_archiver" ]
}
......
......@@ -26,6 +26,10 @@
#include "ui/keyboard/resources/keyboard_resource_util.h"
#endif
#if defined(KIOSK_NEXT) && defined(GOOGLE_CHROME_BUILD)
#include "chrome/grit/kiosk_next_internal_resources_map.h"
#endif
namespace extensions {
ChromeComponentExtensionResourceManager::
......@@ -86,6 +90,11 @@ ChromeComponentExtensionResourceManager() {
keyboard_resources,
keyboard_resource_size);
#endif
#if defined(KIOSK_NEXT) && defined(GOOGLE_CHROME_BUILD)
AddComponentResourceEntries(kKioskNextInternalResources,
kKioskNextInternalResourcesSize);
#endif
}
ChromeComponentExtensionResourceManager::
......
......@@ -205,6 +205,20 @@ if (is_chromeos) {
]
output_dir = "$root_gen_dir/chrome"
}
if (enable_kiosk_next && is_chrome_branded) {
grit("kiosk_next_internal_resources") {
source = "kiosk_next_internal_resources.grd"
defines = chrome_grit_defines
outputs = [
"grit/kiosk_next_internal_resources.h",
"grit/kiosk_next_internal_resources_map.cc",
"grit/kiosk_next_internal_resources_map.h",
"kiosk_next_internal_resources.pak",
]
output_dir = "$root_gen_dir/chrome"
}
}
}
if (!is_android && !is_chromeos) {
......
// Copyright 2019 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.
chrome.app.runtime.onLaunched.addListener(() => {
const windowOptions = {id: 'main', state: 'maximized', frame: 'none'};
chrome.app.window.create('internal/main.html', windowOptions);
});
// TODO(brunoad): Remove when src-internal version is available.
{
"allowed_hosts": [],
"allowed_custom_schemes": []
}
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<include name="IDR_KIOSK_NEXT_INTENT_CONFIG_JSON" file="chromeos/kiosk_next_home/intent_config.json" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_BG_JS" file="chromeos/kiosk_next_home/bg.js" type="BINDATA" />
<if expr="_google_chrome">
<then>
<include name="IDR_KIOSK_NEXT_BG_JS" file="chromeos/kiosk_next_home/bg_internal.js" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_MAIN_HTML" file="chromeos/kiosk_next_home/internal/main.html" type="chrome_html" />
</then>
<else>
<include name="IDR_KIOSK_NEXT_BG_JS" file="chromeos/kiosk_next_home/bg.js" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_MAIN_HTML" file="chromeos/kiosk_next_home/main.html" type="chrome_html" />
</else>
</if>
<include name="IDR_KIOSK_NEXT_ICON_192" file="chromeos/kiosk_next_home/static/icon192.png" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_MAIN_HTML" file="chromeos/kiosk_next_home/main.html" type="chrome_html" />
<include name="IDR_KIOSK_NEXT_API_JS" file="chromeos/kiosk_next_home/api.js" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_API_IMPL_JS" file="chromeos/kiosk_next_home/api_impl.js" type="BINDATA" />
<include name="IDR_KIOSK_NEXT_HOME_MOJOM_JS" file="${root_gen_dir}/chrome/browser/resources/chromeos/kiosk_next_home/mojom_bin.js" type="BINDATA" use_base_dir="false" />
......
<?xml version="1.0" encoding="utf-8"?>
<!-- TODO(brunoad): This list will be populated from src-internal -->
<grit-part />
......@@ -5,8 +5,5 @@
<script src="api_impl.js"></script>
</head>
<body>
<div>
TODO(michaelpg): Remove this when the real files are available from
src-internal.
</div>
<div>Kiosk Next Home</div>
</body>
......@@ -95,9 +95,6 @@
<include name="IDR_ARC_SUPPORT_RECOMMEND_APP_LIST_VIEW_HTML" file="chromeos/arc_support/recommend_app_list_view.html" type="chrome_html" flattenhtml="true" />
<if expr="_kiosk_next">
<part file="chromeos/kiosk_next_home/kiosk_next_resources.grdp" />
<if expr="_google_chrome">
<part file="chromeos/kiosk_next_home/kiosk_next_resources_internal.grdp" />
</if>
</if>
</if>
<if expr="enable_plugins">
......
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/kiosk_next_internal_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/kiosk_next_internal_resources_map.cc" type="gzipped_resource_file_map_source" />
<output filename="grit/kiosk_next_internal_resources_map.h" type="gzipped_resource_map_header" />
<output filename="kiosk_next_internal_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<part file="chromeos/kiosk_next_home/internal/kiosk_next_resources_internal.grdp" />
</includes>
</release>
</grit>
......@@ -8,6 +8,10 @@ import("//extensions/buildflags/buildflags.gni")
import("//ui/base/ui_features.gni")
import("chrome_repack_locales.gni")
if (is_chromeos) {
import("//chrome/browser/chromeos/kiosk_next_home/kiosk_next.gni")
}
# Generates a rule to repack a set of resources, substituting a given string
# in for the percentage (e.g. "100", "200"). It generates the repacked files in
# the "gen" directory, and then introduces a copy rule to copy it to the root
......@@ -166,6 +170,10 @@ template("chrome_extra_paks") {
"//third_party/ink:ink_resources",
"//ui/file_manager:resources",
]
if (enable_kiosk_next && is_chrome_branded) {
sources += [ "$root_gen_dir/chrome/kiosk_next_internal_resources.pak" ]
deps += [ "//chrome/browser/resources:kiosk_next_internal_resources" ]
}
}
if (!is_android && !is_chromeos) {
sources += [ "$root_gen_dir/chrome/onboarding_welcome_resources.pak" ]
......
......@@ -145,6 +145,9 @@
"chrome/browser/vr/testapp/vr_testapp_resources.grd": {
"includes": [13990],
},
"chrome/browser/resources/kiosk_next_internal_resources.grd": {
"includes": [14040],
},
# END chrome/browser section.
# START chrome/ miscellaneous section.
......
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