Skip to content

Commit

Permalink
Move //{chromeos/components => ash/webui}/demo_mode_app_ui
Browse files Browse the repository at this point in the history
This CL moves //chromeos/components/demo_mode_app_ui to
//ash/webui and updates its DEPS.

This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.

Bug: 1164001
Change-Id: I5fd2824df64cb8f8ac446d74fa86c38407ca8157
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3135039
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Owners-Override: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Cr-Commit-Position: refs/heads/main@{#918488}
  • Loading branch information
duswnchl authored and Chromium LUCI CQ committed Sep 6, 2021
1 parent 9d73a3c commit 367142e
Show file tree
Hide file tree
Showing 33 changed files with 59 additions and 73 deletions.
1 change: 1 addition & 0 deletions ash/webui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ group("closure_compile") {

if (!is_official_build) {
deps += [
"//ash/webui/demo_mode_app_ui:closure_compile",
"//ash/webui/sample_system_web_app_ui:closure_compile",
"//ash/webui/telemetry_extension_ui:closure_compile",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ static_library("demo_mode_app_ui") {
]

deps = [
"//chromeos/components/demo_mode_app_ui/mojom",
"//chromeos/resources:demo_mode_app_resources",
"//ash/webui/demo_mode_app_ui/mojom",
"//ash/webui/resources:demo_mode_app_resources",
"//content/public/browser",
"//ui/views",
"//ui/webui",
Expand All @@ -36,7 +36,7 @@ js_type_check("closure_compile") {

js_library("app") {
sources = [ "resources/page_handler.js" ]
deps = [ "//chromeos/components/demo_mode_app_ui/mojom:mojom_webui_js" ]
deps = [ "//ash/webui/demo_mode_app_ui/mojom:mojom_webui_js" ]
}

js2gtest("browser_tests_js") {
Expand All @@ -47,14 +47,15 @@ js2gtest("browser_tests_js") {
defines = [ "HAS_OUT_OF_PROC_TEST_RUNNER" ]
}

grd_prefix = "chromeos_demo_mode_app"
grd_prefix = "ash_demo_mode_app"
mojo_grdp_file = "$target_gen_dir/demo_mode_app_mojo_resources.grdp"

generate_grd("build_mojo_grdp") {
out_grd = mojo_grdp_file
grd_prefix = grd_prefix
deps = [ "//chromeos/components/demo_mode_app_ui/mojom:mojom_webui_js" ]
input_files = [ "chromeos/components/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom-webui.js" ]
deps = [ "//ash/webui/demo_mode_app_ui/mojom:mojom_webui_js" ]
input_files =
[ "ash/webui/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom-webui.js" ]
input_files_base_dir =
rebase_path("$root_gen_dir/mojom-webui", "$root_build_dir")
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/components/demo_mode_app_ui/demo_mode_app_ui.h"
#include "chromeos/components/demo_mode_app_ui/demo_mode_page_handler.h"
#include "chromeos/components/demo_mode_app_ui/url_constants.h"
#include "chromeos/grit/chromeos_demo_mode_app_resources.h"
#include "chromeos/grit/chromeos_demo_mode_app_resources_map.h"
#include "ash/webui/demo_mode_app_ui/demo_mode_app_ui.h"

#include "ash/grit/ash_demo_mode_app_resources.h"
#include "ash/grit/ash_demo_mode_app_resources_map.h"
#include "ash/webui/demo_mode_app_ui/demo_mode_page_handler.h"
#include "ash/webui/demo_mode_app_ui/url_constants.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
#include "services/network/public/mojom/content_security_policy.mojom.h"
Expand All @@ -20,13 +21,12 @@ DemoModeAppUI::DemoModeAppUI(content::WebUI* web_ui)
content::WebUIDataSource::Create(chromeos::kChromeUIDemoModeAppHost);

// Add required resources.
for (size_t i = 0; i < kChromeosDemoModeAppResourcesSize; ++i) {
html_source->AddResourcePath(kChromeosDemoModeAppResources[i].path,
kChromeosDemoModeAppResources[i].id);
for (size_t i = 0; i < kAshDemoModeAppResourcesSize; ++i) {
html_source->AddResourcePath(kAshDemoModeAppResources[i].path,
kAshDemoModeAppResources[i].id);
}

html_source->SetDefaultResource(
IDR_CHROMEOS_DEMO_MODE_APP_DEMO_MODE_APP_HTML);
html_source->SetDefaultResource(IDR_ASH_DEMO_MODE_APP_DEMO_MODE_APP_HTML);

auto* browser_context = web_ui->GetWebContents()->GetBrowserContext();
content::WebUIDataSource::Add(browser_context, html_source);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_
#define CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_
#ifndef ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_
#define ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_

#include "chromeos/components/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"
#include "ash/webui/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
Expand Down Expand Up @@ -40,4 +40,4 @@ class DemoModeAppUI : public ui::MojoWebUIController,

} // namespace chromeos

#endif // CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_
#endif // ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_APP_UI_H_
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/components/demo_mode_app_ui/demo_mode_page_handler.h"
#include "ash/webui/demo_mode_app_ui/demo_mode_page_handler.h"

namespace chromeos {
DemoModePageHandler::DemoModePageHandler(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_
#define CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_
#ifndef ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_
#define ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_

#include "chromeos/components/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"
#include "ash/webui/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"

#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
Expand All @@ -32,4 +32,4 @@ class DemoModePageHandler : public mojom::demo_mode::PageHandler {
views::Widget* widget_;
};
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_
#endif // ASH_WEBUI_DEMO_MODE_APP_UI_DEMO_MODE_PAGE_HANDLER_H_
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ assert(!is_official_build, "Demo Mode App is only built for unofficial builds")
mojom("mojom") {
sources = [ "demo_mode_app_ui.mojom" ]
public_deps = [ "//mojo/public/mojom/base" ]
webui_module_path = "/chromeos/components/demo_mode_app_ui/mojom/"
webui_module_path = "/ash/webui/demo_mode_app_ui/mojom/"
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import {PageHandlerFactory, PageHandlerRemote} from '/chromeos/components/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom-webui.js';
import {PageHandlerFactory, PageHandlerRemote} from '/ash/webui/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom-webui.js';

/**
* Provides interfaces for sending and receiving messages to/from the browser
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chromeos/components/demo_mode_app_ui/url_constants.h"
#include "ash/webui/demo_mode_app_ui/url_constants.h"

namespace chromeos {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_URL_CONSTANTS_H_
#define CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_URL_CONSTANTS_H_
#ifndef ASH_WEBUI_DEMO_MODE_APP_UI_URL_CONSTANTS_H_
#define ASH_WEBUI_DEMO_MODE_APP_UI_URL_CONSTANTS_H_

namespace chromeos {

Expand All @@ -12,4 +12,4 @@ extern const char kChromeUIDemoModeAppURL[];

} // namespace chromeos

#endif // CHROMEOS_COMPONENTS_DEMO_MODE_APP_UI_URL_CONSTANTS_H_
#endif // ASH_WEBUI_DEMO_MODE_APP_UI_URL_CONSTANTS_H_
6 changes: 6 additions & 0 deletions ash/webui/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ ash_generated_grit("shimless_rma_resources") {
}

if (!is_official_build) {
# Resources used by chrome://demo-mode-app
ash_generated_grit("demo_mode_app_resources") {
source = "$root_gen_dir/ash/webui/demo_mode_app_ui/ash_demo_mode_app_resources.grd"
deps = [ "//ash/webui/demo_mode_app_ui:build_grd" ]
}

# Resources used by chrome://sample-system-web-app
ash_generated_grit("sample_system_web_app_resources") {
source = "$root_gen_dir/ash/webui/sample_system_web_app_ui/ash_sample_system_web_app_resources.grd"
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2468,12 +2468,12 @@ static_library("browser") {
]
if (!is_official_build) {
deps += [
"//ash/webui/demo_mode_app_ui",
"//ash/webui/demo_mode_app_ui/mojom",
"//ash/webui/sample_system_web_app_ui",
"//ash/webui/sample_system_web_app_ui/mojom",
"//ash/webui/telemetry_extension_ui",
"//ash/webui/telemetry_extension_ui/mojom",
"//chromeos/components/demo_mode_app_ui",
"//chromeos/components/demo_mode_app_ui/mojom",
]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// found in the LICENSE file.

#include "ash/constants/ash_features.h"
#include "ash/webui/demo_mode_app_ui/url_constants.h"
#include "base/scoped_observation.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/ash/web_applications/system_web_app_integration_test.h"
#include "chromeos/components/demo_mode_app_ui/url_constants.h"
#include "content/public/test/browser_test.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_observer.h"
Expand Down
7 changes: 4 additions & 3 deletions chrome/browser/ash/web_applications/demo_mode_web_app_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
// found in the LICENSE file.

#include "chrome/browser/ash/web_applications/demo_mode_web_app_info.h"

#include "ash/constants/ash_features.h"
#include "ash/grit/ash_demo_mode_app_resources.h"
#include "ash/webui/demo_mode_app_ui/url_constants.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ash/web_applications/system_web_app_install_utils.h"
#include "chrome/browser/web_applications/components/web_application_info.h"
#include "chromeos/components/demo_mode_app_ui/url_constants.h"
#include "chromeos/grit/chromeos_demo_mode_app_resources.h"

std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForDemoModeApp() {
std::unique_ptr<WebApplicationInfo> info =
Expand All @@ -19,7 +20,7 @@ std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForDemoModeApp() {
info->title = u"Demo Mode App";
web_app::CreateIconInfoForSystemWebApp(
info->start_url,
{{"app_icon_192.png", 192, IDR_CHROMEOS_DEMO_MODE_APP_APP_ICON_192_PNG}},
{{"app_icon_192.png", 192, IDR_ASH_DEMO_MODE_APP_APP_ICON_192_PNG}},
*info);
info->theme_color = 0xFF4285F4;
info->background_color = 0xFFFFFFFF;
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chrome_browser_interface_binders.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,14 @@
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#include "ash/webui/demo_mode_app_ui/demo_mode_app_ui.h"
#include "ash/webui/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"
#include "ash/webui/sample_system_web_app_ui/mojom/sample_system_web_app_ui.mojom.h"
#include "ash/webui/sample_system_web_app_ui/sample_system_web_app_ui.h"
#include "ash/webui/telemetry_extension_ui/mojom/diagnostics_service.mojom.h" // nogncheck crbug.com/1125897
#include "ash/webui/telemetry_extension_ui/mojom/probe_service.mojom.h" // nogncheck crbug.com/1125897
#include "ash/webui/telemetry_extension_ui/mojom/system_events_service.mojom.h" // nogncheck crbug.com/1125897
#include "ash/webui/telemetry_extension_ui/telemetry_extension_ui.h"
#include "chromeos/components/demo_mode_app_ui/demo_mode_app_ui.h"
#include "chromeos/components/demo_mode_app_ui/mojom/demo_mode_app_ui.mojom.h"
#endif

#if BUILDFLAG(ENABLE_EXTENSIONS)
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -3337,13 +3337,13 @@ source_set("chromeos") {

if (!is_official_build) {
deps += [
"//ash/webui/demo_mode_app_ui",
"//ash/webui/resources:demo_mode_app_resources_grit",
"//ash/webui/resources:sample_system_web_app_resources_grit",
"//ash/webui/resources:sample_system_web_app_untrusted_resources_grit",
"//ash/webui/resources:telemetry_extension_resources",
"//ash/webui/sample_system_web_app_ui",
"//ash/webui/telemetry_extension_ui",
"//chromeos/components/demo_mode_app_ui",
"//chromeos/resources:demo_mode_app_resources_grit",
]
sources += [
"../ash/web_applications/demo_mode_web_app_info.cc",
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2942,9 +2942,9 @@ static_library("ui") {
]
}
deps += [
"//ash/webui/demo_mode_app_ui",
"//ash/webui/sample_system_web_app_ui",
"//ash/webui/telemetry_extension_ui",
"//chromeos/components/demo_mode_app_ui",
]
}

Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@
#endif

#if BUILDFLAG(IS_CHROMEOS_ASH) && !defined(OFFICIAL_BUILD)
#include "ash/webui/demo_mode_app_ui/demo_mode_app_ui.h"
#include "ash/webui/demo_mode_app_ui/url_constants.h"
#include "ash/webui/sample_system_web_app_ui/sample_system_web_app_ui.h"
#include "ash/webui/sample_system_web_app_ui/url_constants.h"
#include "ash/webui/telemetry_extension_ui/telemetry_extension_ui.h"
#include "ash/webui/telemetry_extension_ui/url_constants.h"
#include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h"
#include "chromeos/components/demo_mode_app_ui/demo_mode_app_ui.h"
#include "chromeos/components/demo_mode_app_ui/url_constants.h"
#endif

#if !defined(OS_CHROMEOS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enum class SystemAppType {
// development. Prefer to file bugs to the internal Demo Mode component:
// b/components/812312
//
// Source: //chromeos/components/demo_mode_app_ui/
// Source: //ash/webui/demo_mode_app_ui/
// Contact: jacksontadie@google.com, drcrash@chromium.org
DEMO_MODE = 18,

Expand Down
4 changes: 2 additions & 2 deletions chrome/chrome_paks.gni
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,16 @@ template("chrome_extra_paks") {

if (!is_official_build) {
sources += [
"$root_gen_dir/ash/ash_demo_mode_app_resources.pak",
"$root_gen_dir/ash/ash_sample_system_web_app_resources.pak",
"$root_gen_dir/ash/ash_sample_system_web_app_untrusted_resources.pak",
"$root_gen_dir/ash/ash_telemetry_extension_resources.pak",
"$root_gen_dir/chromeos/chromeos_demo_mode_app_resources.pak",
]
deps += [
"//ash/webui/resources:demo_mode_app_resources",
"//ash/webui/resources:sample_system_web_app_resources",
"//ash/webui/resources:sample_system_web_app_untrusted_resources",
"//ash/webui/resources:telemetry_extension_resources",
"//chromeos/resources:demo_mode_app_resources",
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions chrome/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2284,9 +2284,9 @@ if (!is_android && !is_fuchsia) {

if (!is_official_build) {
deps += [
"//ash/webui/demo_mode_app_ui:browser_tests_js",
"//ash/webui/sample_system_web_app_ui:browser_tests_js",
"//ash/webui/telemetry_extension_ui/test:browser_tests_js",
"//chromeos/components/demo_mode_app_ui:browser_tests_js",
]
}
}
Expand Down Expand Up @@ -3438,9 +3438,9 @@ if (!is_android && !is_fuchsia) {
"../browser/ash/web_applications/telemetry_extension_integration_browsertest.cc",
]
deps += [
"//ash/webui/demo_mode_app_ui",
"//ash/webui/sample_system_web_app_ui",
"//ash/webui/telemetry_extension_ui",
"//chromeos/components/demo_mode_app_ui",
]
}
if (use_dbus) {
Expand Down
9 changes: 0 additions & 9 deletions chromeos/components/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,4 @@ group("closure_compile") {
"//chromeos/components/projector_app/resources:closure_compile",
"//chromeos/components/system_apps:closure_compile",
]

if (!is_official_build) {
deps += [
# TODO (https://crbug.com/1164001): move
# //chromeos/components/demo_mode_app_ui/ WebUI directory to
# //ash/webui/demo_mode_app_ui
"//chromeos/components/demo_mode_app_ui:closure_compile",
]
}
}
6 changes: 0 additions & 6 deletions chromeos/components/demo_mode_app_ui/DEPS

This file was deleted.

8 changes: 0 additions & 8 deletions chromeos/resources/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,6 @@ grit("projector_app_bundle_resources") {
output_dir = "$root_gen_dir/chromeos"
}

if (!is_official_build) {
# Resources used by chrome://demo-mode-app
chromeos_generated_grit("demo_mode_app_resources") {
source = "$root_gen_dir/chromeos/components/demo_mode_app_ui/chromeos_demo_mode_app_resources.grd"
deps = [ "//chromeos/components/demo_mode_app_ui:build_grd" ]
}
}

# Resources used by chrome://connectivity-diagnostics
grit("connectivity_diagnostics_resources") {
# These arguments are needed since the grd is generated at build time.
Expand Down
2 changes: 1 addition & 1 deletion tools/gritsettings/resource_ids.spec
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
"META": {"sizes": {"includes": [50],}},
"includes": [2695],
},
"<(SHARED_INTERMEDIATE_DIR)/chromeos/components/demo_mode_app_ui/chromeos_demo_mode_app_resources.grd": {
"<(SHARED_INTERMEDIATE_DIR)/ash/webui/demo_mode_app_ui/ash_demo_mode_app_resources.grd": {
"META": {"sizes": {"includes": [50],}},
"includes": [2700],
},
Expand Down

0 comments on commit 367142e

Please sign in to comment.