Commit e1c533b7 authored by Findit's avatar Findit

Revert "Files SWA: Moving to a new directory."

This reverts commit 4ccb6508.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 805598 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzRjY2I2NTA4MDBjZDdkZTgzYWUzY2RiNzFkMzNiZmQ5N2NmZTBkOWYM

Sample Failed Build: https://ci.chromium.org/b/8869579849484323600

Sample Failed Step: compile

Original change's description:
> Files SWA: Moving to a new directory.
> 
> Bug: 1111229
> Change-Id: Id0509caf9d1d9de8efa293344e682610cf1a8699
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2381330
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Kyle Horimoto <khorimoto@chromium.org>
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Reviewed-by: Jiewei Qian  <qjw@chromium.org>
> Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org>
> Commit-Queue: Bo Majewski <majewski@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#805598}


Change-Id: Iaced93329ca1f5e37d6cec4f9e3fdf6b5ae8664f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1111229
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2401927
Cr-Commit-Position: refs/heads/master@{#805604}
parent ed8efc89
...@@ -6015,6 +6015,7 @@ grit("resources") { ...@@ -6015,6 +6015,7 @@ grit("resources") {
"//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings_js",
"//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings_js",
"//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings_js",
"//chrome/browser/ui/webui/chromeos/file_manager:mojo_bindings_js",
"//chrome/browser/ui/webui/chromeos/machine_learning:mojo_bindings_js", "//chrome/browser/ui/webui/chromeos/machine_learning:mojo_bindings_js",
"//chrome/browser/ui/webui/settings/chromeos:mojom_js", "//chrome/browser/ui/webui/settings/chromeos:mojom_js",
] ]
......
...@@ -279,6 +279,12 @@ ...@@ -279,6 +279,12 @@
<include name="IDR_DRIVE_INTERNALS_HTML" file="resources\chromeos\drive_internals.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_DRIVE_INTERNALS_HTML" file="resources\chromeos\drive_internals.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_DRIVE_INTERNALS_JS" file="resources\chromeos\drive_internals.js" type="BINDATA" /> <include name="IDR_DRIVE_INTERNALS_JS" file="resources\chromeos\drive_internals.js" type="BINDATA" />
<include name="IDR_FILE_MANAGER_CSS" file="resources\chromeos\file_manager\file_manager.css" type="BINDATA" />
<include name="IDR_FILE_MANAGER_HTML" file="resources\chromeos\file_manager\file_manager.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_FILE_MANAGER_JS" file="resources\chromeos\file_manager\file_manager.js" type="BINDATA" />
<include name="IDR_FILE_MANAGER_MOJO_LITE_JS" file="${root_gen_dir}\chrome\browser\ui\webui\chromeos\file_manager\file_manager.mojom-lite.js" use_base_dir="false" type="BINDATA" />
<include name="IDR_FILE_MANAGER_PROXY_JS" file="resources\chromeos\file_manager\browser_proxy.js" type="BINDATA" />
<include name="IDR_GUEST_SESSION_TAB_HTML" file="resources\chromeos\guest_session_tab.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_GUEST_SESSION_TAB_HTML" file="resources\chromeos\guest_session_tab.html" flattenhtml="true" type="BINDATA" />
<!-- Note: mobile_setup_ui.cc does not support compressed resources. --> <!-- Note: mobile_setup_ui.cc does not support compressed resources. -->
......
...@@ -153,6 +153,8 @@ ...@@ -153,6 +153,8 @@
#include "chrome/browser/ui/webui/chromeos/crostini_installer/crostini_installer_ui.h" #include "chrome/browser/ui/webui/chromeos/crostini_installer/crostini_installer_ui.h"
#include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader.mojom.h" #include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader.mojom.h"
#include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_ui.h" #include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_ui.h"
#include "chrome/browser/ui/webui/chromeos/file_manager/file_manager.mojom.h"
#include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_ui.h"
#include "chrome/browser/ui/webui/chromeos/internet_config_dialog.h" #include "chrome/browser/ui/webui/chromeos/internet_config_dialog.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h" #include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
...@@ -166,8 +168,6 @@ ...@@ -166,8 +168,6 @@
#include "chrome/browser/ui/webui/settings/chromeos/search/user_action_recorder.mojom.h" #include "chrome/browser/ui/webui/settings/chromeos/search/user_action_recorder.mojom.h"
#include "chromeos/components/camera_app_ui/camera_app_helper.mojom.h" #include "chromeos/components/camera_app_ui/camera_app_helper.mojom.h"
#include "chromeos/components/camera_app_ui/camera_app_ui.h" #include "chromeos/components/camera_app_ui/camera_app_ui.h"
#include "chromeos/components/file_manager/file_manager.mojom.h"
#include "chromeos/components/file_manager/file_manager_ui.h"
#include "chromeos/components/help_app_ui/help_app_ui.h" #include "chromeos/components/help_app_ui/help_app_ui.h"
#include "chromeos/components/help_app_ui/help_app_ui.mojom.h" #include "chromeos/components/help_app_ui/help_app_ui.mojom.h"
#include "chromeos/components/media_app_ui/media_app_ui.h" #include "chromeos/components/media_app_ui/media_app_ui.h"
......
...@@ -2837,16 +2837,12 @@ source_set("chromeos") { ...@@ -2837,16 +2837,12 @@ source_set("chromeos") {
if (!is_official_build) { if (!is_official_build) {
deps += [ deps += [
"//chromeos/components/file_manager:file_manager_ui",
"//chromeos/components/sample_system_web_app_ui", "//chromeos/components/sample_system_web_app_ui",
"//chromeos/components/telemetry_extension_ui", "//chromeos/components/telemetry_extension_ui",
"//chromeos/resources:file_manager_resources_grit",
"//chromeos/resources:sample_system_web_app_resources_grit", "//chromeos/resources:sample_system_web_app_resources_grit",
"//chromeos/resources:telemetry_extension_resources", "//chromeos/resources:telemetry_extension_resources",
] ]
sources += [ sources += [
"web_applications/file_manager_web_app_info.cc",
"web_applications/file_manager_web_app_info.h",
"web_applications/sample_system_web_app_info.cc", "web_applications/sample_system_web_app_info.cc",
"web_applications/sample_system_web_app_info.h", "web_applications/sample_system_web_app_info.h",
"web_applications/telemetry_extension_web_app_info.cc", "web_applications/telemetry_extension_web_app_info.cc",
......
// Copyright 2020 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.
#include "chrome/browser/chromeos/web_applications/file_manager_web_app_info.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/web_applications/system_web_app_install_utils.h"
#include "chrome/browser/web_applications/components/web_app_constants.h"
#include "chrome/common/web_application_info.h"
#include "chromeos/components/file_manager/url_constants.h"
#include "chromeos/grit/chromeos_file_manager_resources.h"
#include "third_party/blink/public/mojom/manifest/display_mode.mojom.h"
std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForFileManager() {
auto info = std::make_unique<WebApplicationInfo>();
info->app_url = GURL(chromeos::file_manager::kChromeUIFileManagerURL);
info->scope = GURL(chromeos::file_manager::kChromeUIFileManagerURL);
// TODO(majewski): Fetch from a resource.
info->title = base::UTF8ToUTF16("File Manager");
web_app::CreateIconInfoForSystemWebApp(info->app_url, "icon192.png", 192,
IDR_FILE_MANAGER_ICON_192, *info);
info->theme_color = 0xFF4285F4;
info->background_color = 0xFFFFFFFF;
info->display_mode = blink::mojom::DisplayMode::kStandalone;
info->open_as_window = true;
return info;
}
// Copyright 2020 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.
#ifndef CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_FILE_MANAGER_WEB_APP_INFO_H_
#define CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_FILE_MANAGER_WEB_APP_INFO_H_
#include <memory>
#if defined(OFFICIAL_BUILD)
#error File Manager should only be included in unofficial builds.
#endif
struct WebApplicationInfo;
// Return a WebApplicationInfo used to install the app.
std::unique_ptr<WebApplicationInfo> CreateWebAppInfoForFileManager();
#endif // CHROME_BROWSER_CHROMEOS_WEB_APPLICATIONS_FILE_MANAGER_WEB_APP_INFO_H_
file://ui/file_manager/OWNERS
# COMPONENT: Platform>Apps>FileManager
/* Copyright (c) 2020 The Chromium Authors. All rights reserved. /* Copyright (c) 2020 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be * Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */ * found in the LICENSE file. */
...@@ -20,6 +20,6 @@ theBrowserProxy.callbackRouter.onSomethingHappened.addListener( ...@@ -20,6 +20,6 @@ theBrowserProxy.callbackRouter.onSomethingHappened.addListener(
console.log('eh? ' + something + '. what? ' + other); console.log('eh? ' + something + '. what? ' + other);
}); });
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', function() {
console.info('File manager launched ...'); alert('DOMContentLoaded');
}); });
...@@ -2166,6 +2166,10 @@ static_library("ui") { ...@@ -2166,6 +2166,10 @@ static_library("ui") {
"webui/chromeos/drive_internals_ui.h", "webui/chromeos/drive_internals_ui.h",
"webui/chromeos/edu_account_login_handler_chromeos.cc", "webui/chromeos/edu_account_login_handler_chromeos.cc",
"webui/chromeos/edu_account_login_handler_chromeos.h", "webui/chromeos/edu_account_login_handler_chromeos.h",
"webui/chromeos/file_manager/file_manager_page_handler.cc",
"webui/chromeos/file_manager/file_manager_page_handler.h",
"webui/chromeos/file_manager/file_manager_ui.cc",
"webui/chromeos/file_manager/file_manager_ui.h",
"webui/chromeos/first_run/first_run_actor.cc", "webui/chromeos/first_run/first_run_actor.cc",
"webui/chromeos/first_run/first_run_actor.h", "webui/chromeos/first_run/first_run_actor.h",
"webui/chromeos/first_run/first_run_handler.cc", "webui/chromeos/first_run/first_run_handler.cc",
...@@ -2534,6 +2538,7 @@ static_library("ui") { ...@@ -2534,6 +2538,7 @@ static_library("ui") {
"//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings", "//chrome/browser/ui/webui/chromeos/add_supervision:mojo_bindings",
"//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings", "//chrome/browser/ui/webui/chromeos/crostini_installer:mojo_bindings",
"//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings", "//chrome/browser/ui/webui/chromeos/crostini_upgrader:mojo_bindings",
"//chrome/browser/ui/webui/chromeos/file_manager:mojo_bindings",
"//chrome/browser/ui/webui/chromeos/machine_learning:mojo_bindings", "//chrome/browser/ui/webui/chromeos/machine_learning:mojo_bindings",
"//chrome/browser/ui/webui/settings/chromeos/constants:mojom", "//chrome/browser/ui/webui/settings/chromeos/constants:mojom",
"//chrome/browser/ui/webui/settings/chromeos/search:mojo_bindings", "//chrome/browser/ui/webui/settings/chromeos/search:mojo_bindings",
...@@ -2639,7 +2644,6 @@ static_library("ui") { ...@@ -2639,7 +2644,6 @@ static_library("ui") {
] ]
} }
deps += [ deps += [
"//chromeos/components/file_manager:file_manager_ui",
"//chromeos/components/sample_system_web_app_ui", "//chromeos/components/sample_system_web_app_ui",
"//chromeos/components/telemetry_extension_ui", "//chromeos/components/telemetry_extension_ui",
] ]
......
...@@ -178,6 +178,7 @@ ...@@ -178,6 +178,7 @@
#include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_ui.h" #include "chrome/browser/ui/webui/chromeos/crostini_upgrader/crostini_upgrader_ui.h"
#include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h" #include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h"
#include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h" #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h"
#include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_ui.h"
#include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h" #include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h"
#include "chrome/browser/ui/webui/chromeos/internet_config_dialog.h" #include "chrome/browser/ui/webui/chromeos/internet_config_dialog.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h" #include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
...@@ -218,8 +219,6 @@ ...@@ -218,8 +219,6 @@
#if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD) #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD)
#include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h" #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h"
#include "chromeos/components/file_manager/file_manager_ui.h"
#include "chromeos/components/file_manager/url_constants.h"
#include "chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.h" #include "chromeos/components/sample_system_web_app_ui/sample_system_web_app_ui.h"
#include "chromeos/components/sample_system_web_app_ui/url_constants.h" #include "chromeos/components/sample_system_web_app_ui/url_constants.h"
#include "chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h" #include "chromeos/components/telemetry_extension_ui/telemetry_extension_ui.h"
...@@ -649,6 +648,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -649,6 +648,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<chromeos::CryptohomeUI>; return &NewWebUI<chromeos::CryptohomeUI>;
if (url.host_piece() == chrome::kChromeUIDriveInternalsHost) if (url.host_piece() == chrome::kChromeUIDriveInternalsHost)
return &NewWebUI<chromeos::DriveInternalsUI>; return &NewWebUI<chromeos::DriveInternalsUI>;
if (base::FeatureList::IsEnabled(chromeos::features::kFilesSWA) &&
url.host_piece() == chrome::kChromeUIFileManagerHost)
return &NewWebUI<chromeos::file_manager::FileManagerUI>;
if (url.host_piece() == chrome::kChromeUIFirstRunHost) if (url.host_piece() == chrome::kChromeUIFirstRunHost)
return &NewWebUI<chromeos::FirstRunUI>; return &NewWebUI<chromeos::FirstRunUI>;
if (url.host_piece() == chromeos::kChromeUIHelpAppHost) if (url.host_piece() == chromeos::kChromeUIHelpAppHost)
...@@ -733,8 +735,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -733,8 +735,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<DeviceEmulatorUI>; return &NewWebUI<DeviceEmulatorUI>;
} }
#endif // !defined(USE_REAL_DBUS_CLIENTS) #endif // !defined(USE_REAL_DBUS_CLIENTS)
if (url.host_piece() == chromeos::file_manager::kChromeUIFileManagerHost)
return &NewWebUI<chromeos::file_manager::FileManagerUI>;
if (url.host_piece() == chromeos::kChromeUISampleSystemWebAppHost) if (url.host_piece() == chromeos::kChromeUISampleSystemWebAppHost)
return &NewWebUI<chromeos::SampleSystemWebAppUI>; return &NewWebUI<chromeos::SampleSystemWebAppUI>;
if (url.host_piece() == chromeos::kChromeUITelemetryExtensionHost) { if (url.host_piece() == chromeos::kChromeUITelemetryExtensionHost) {
......
...@@ -2,16 +2,8 @@ ...@@ -2,16 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//third_party/closure_compiler/compile_js.gni") import("//mojo/public/tools/bindings/mojom.gni")
js_library("file_manager_js") { mojom("mojo_bindings") {
sources = [ sources = [ "file_manager.mojom" ]
"browser_proxy.js",
"file_manager.js",
]
deps = [ "//chromeos/components/file_manager:file_manager_mojom_js_library_for_compile" ]
}
js_type_check("closure_compile") {
deps = [ ":file_manager_js" ]
} }
...@@ -2,9 +2,15 @@ ...@@ -2,9 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chromeos/components/file_manager/file_manager_page_handler.h" #include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_ui.h"
#include "base/bind.h" #include "base/bind.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_page_handler.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/browser_resources.h"
#include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h"
namespace chromeos { namespace chromeos {
namespace file_manager { namespace file_manager {
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_ #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_
#define CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_ #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_
#include <memory> #include <memory>
#include "base/macros.h" #include "base/macros.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "chromeos/components/file_manager/file_manager.mojom.h" #include "chrome/browser/ui/webui/chromeos/file_manager/file_manager.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
...@@ -47,4 +47,4 @@ class FileManagerPageHandler : public mojom::PageHandler { ...@@ -47,4 +47,4 @@ class FileManagerPageHandler : public mojom::PageHandler {
} // namespace file_manager } // namespace file_manager
} // namespace chromeos } // namespace chromeos
#endif // CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_ #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_PAGE_HANDLER_H_
...@@ -2,13 +2,12 @@ ...@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chromeos/components/file_manager/file_manager_ui.h" #include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_ui.h"
#include "base/memory/ptr_util.h" #include "chrome/browser/profiles/profile.h"
#include "chromeos/components/file_manager/file_manager_page_handler.h" #include "chrome/browser/ui/webui/chromeos/file_manager/file_manager_page_handler.h"
#include "chromeos/components/file_manager/url_constants.h" #include "chrome/common/url_constants.h"
#include "chromeos/grit/chromeos_file_manager_resources.h" #include "chrome/grit/browser_resources.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/browser/web_ui_data_source.h" #include "content/public/browser/web_ui_data_source.h"
...@@ -17,30 +16,20 @@ namespace file_manager { ...@@ -17,30 +16,20 @@ namespace file_manager {
FileManagerUI::FileManagerUI(content::WebUI* web_ui) FileManagerUI::FileManagerUI(content::WebUI* web_ui)
: MojoWebUIController(web_ui) { : MojoWebUIController(web_ui) {
auto source = base::WrapUnique(content::WebUIDataSource::Create( content::WebUIDataSource* source =
chromeos::file_manager::kChromeUIFileManagerHost)); content::WebUIDataSource::Create(chrome::kChromeUIFileManagerHost);
// The HTML content loaded on chrome://file-manager. source->AddResourcePath("file_manager.css", IDR_FILE_MANAGER_CSS);
source->AddResourcePath("", IDR_FILE_MANAGER_FILE_MANAGER_HTML); source->AddResourcePath("file_manager.js", IDR_FILE_MANAGER_JS);
// The resources requested by chrome://file-manager HTML.
source->AddResourcePath("file_manager.css",
IDR_FILE_MANAGER_FILE_MANAGER_CSS);
source->AddResourcePath("file_manager.js", IDR_FILE_MANAGER_FILE_MANAGER_JS);
source->AddResourcePath("file_manager.mojom-lite.js", source->AddResourcePath("file_manager.mojom-lite.js",
IDR_FILE_MANAGER_MOJO_LITE_JS); IDR_FILE_MANAGER_MOJO_LITE_JS);
source->AddResourcePath("browser_proxy.js", source->AddResourcePath("browser_proxy.js", IDR_FILE_MANAGER_PROXY_JS);
IDR_FILE_MANAGER_BROWSER_PROXY_JS);
#if !DCHECK_IS_ON() // Default content for chrome://file-manager: ensures unhandled URLs return
// If a user goes to an invalid url and non-DCHECK mode (DHECK = debug mode) // 404 rather than content from SetDefaultResource().
// is set, serve a default page so the user sees your default page instead source->AddResourcePath("", IDR_FILE_MANAGER_HTML);
// of an unexpected error. But if DCHECK is set, the user will be a
// developer and be able to identify an error occurred.
source->SetDefaultResource(IDR_FILE_MANAGER_FILE_MANAGER_HTML);
#endif // !DCHECK_IS_ON()
auto* browser_context = web_ui->GetWebContents()->GetBrowserContext(); Profile* profile = Profile::FromWebUI(web_ui);
content::WebUIDataSource::Add(browser_context, source.release()); content::WebUIDataSource::Add(profile, source);
} }
FileManagerUI::~FileManagerUI() = default; FileManagerUI::~FileManagerUI() = default;
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_UI_H_ #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_UI_H_
#define CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_UI_H_ #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_UI_H_
#include <memory> #include <memory>
#include "chromeos/components/file_manager/file_manager.mojom.h" #include "chrome/browser/ui/webui/chromeos/file_manager/file_manager.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver.h"
...@@ -47,4 +47,4 @@ class FileManagerUI : public ui::MojoWebUIController, ...@@ -47,4 +47,4 @@ class FileManagerUI : public ui::MojoWebUIController,
} // namespace file_manager } // namespace file_manager
} // namespace chromeos } // namespace chromeos
#endif // CHROMEOS_COMPONENTS_FILE_MANAGER_FILE_MANAGER_UI_H_ #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_FILE_MANAGER_FILE_MANAGER_UI_H_
...@@ -118,10 +118,7 @@ source_set("web_applications") { ...@@ -118,10 +118,7 @@ source_set("web_applications") {
] ]
if (!is_official_build) { if (!is_official_build) {
deps += [ deps += [ "//chromeos/components/sample_system_web_app_ui" ]
"//chromeos/components/file_manager:file_manager_ui",
"//chromeos/components/sample_system_web_app_ui",
]
} }
} }
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
#include "chrome/browser/chromeos/web_applications/file_manager_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/sample_system_web_app_info.h" #include "chrome/browser/chromeos/web_applications/sample_system_web_app_info.h"
#include "chrome/browser/chromeos/web_applications/telemetry_extension_web_app_info.h" #include "chrome/browser/chromeos/web_applications/telemetry_extension_web_app_info.h"
#endif // !defined(OFFICIAL_BUILD) #endif // !defined(OFFICIAL_BUILD)
...@@ -193,12 +192,6 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() { ...@@ -193,12 +192,6 @@ base::flat_map<SystemAppType, SystemAppInfo> CreateSystemWebApps() {
base::BindRepeating(&CreateWebAppInfoForTelemetryExtension))); base::BindRepeating(&CreateWebAppInfoForTelemetryExtension)));
} }
infos.emplace(
SystemAppType::FILE_MANAGER,
SystemAppInfo("File Manager", GURL("chrome://file-manager"),
base::BindRepeating(&CreateWebAppInfoForFileManager)));
infos.at(SystemAppType::FILE_MANAGER).capture_navigations = true;
infos.emplace( infos.emplace(
SystemAppType::SAMPLE, SystemAppType::SAMPLE,
SystemAppInfo( SystemAppInfo(
...@@ -331,8 +324,6 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) { ...@@ -331,8 +324,6 @@ bool SystemWebAppManager::IsAppEnabled(SystemAppType type) {
case SystemAppType::TELEMETRY: case SystemAppType::TELEMETRY:
return base::FeatureList::IsEnabled( return base::FeatureList::IsEnabled(
chromeos::features::kTelemetryExtension); chromeos::features::kTelemetryExtension);
case SystemAppType::FILE_MANAGER:
return base::FeatureList::IsEnabled(chromeos::features::kFilesSWA);
case SystemAppType::SAMPLE: case SystemAppType::SAMPLE:
NOTREACHED(); NOTREACHED();
return false; return false;
......
...@@ -57,7 +57,6 @@ enum class SystemAppType { ...@@ -57,7 +57,6 @@ enum class SystemAppType {
SCANNING, SCANNING,
DIAGNOSTICS, DIAGNOSTICS,
#if !defined(OFFICIAL_BUILD) #if !defined(OFFICIAL_BUILD)
FILE_MANAGER,
TELEMETRY, TELEMETRY,
SAMPLE, SAMPLE,
#endif // !defined(OFFICIAL_BUILD) #endif // !defined(OFFICIAL_BUILD)
......
...@@ -208,12 +208,10 @@ template("chrome_extra_paks") { ...@@ -208,12 +208,10 @@ template("chrome_extra_paks") {
if (!is_official_build) { if (!is_official_build) {
sources += [ sources += [
"$root_gen_dir/chromeos/chromeos_file_manager_resources.pak",
"$root_gen_dir/chromeos/chromeos_sample_system_web_app_resources.pak", "$root_gen_dir/chromeos/chromeos_sample_system_web_app_resources.pak",
"$root_gen_dir/chromeos/chromeos_telemetry_extension_resources.pak", "$root_gen_dir/chromeos/chromeos_telemetry_extension_resources.pak",
] ]
deps += [ deps += [
"//chromeos/resources:file_manager_resources",
"//chromeos/resources:sample_system_web_app_resources", "//chromeos/resources:sample_system_web_app_resources",
"//chromeos/resources:telemetry_extension_resources", "//chromeos/resources:telemetry_extension_resources",
] ]
......
...@@ -241,6 +241,7 @@ const char kChromeUICrostiniUpgraderUrl[] = "chrome://crostini-upgrader"; ...@@ -241,6 +241,7 @@ const char kChromeUICrostiniUpgraderUrl[] = "chrome://crostini-upgrader";
const char kChromeUICryptohomeHost[] = "cryptohome"; const char kChromeUICryptohomeHost[] = "cryptohome";
const char kChromeUIDeviceEmulatorHost[] = "device-emulator"; const char kChromeUIDeviceEmulatorHost[] = "device-emulator";
const char kChromeUIDiscoverURL[] = "chrome://oobe/discover"; const char kChromeUIDiscoverURL[] = "chrome://oobe/discover";
const char kChromeUIFileManagerHost[] = "file-manager";
const char kChromeUIFirstRunHost[] = "first-run"; const char kChromeUIFirstRunHost[] = "first-run";
const char kChromeUIFirstRunURL[] = "chrome://first-run/"; const char kChromeUIFirstRunURL[] = "chrome://first-run/";
const char kChromeUIIntenetConfigDialogURL[] = const char kChromeUIIntenetConfigDialogURL[] =
......
...@@ -236,6 +236,7 @@ extern const char kChromeUICrostiniUpgraderUrl[]; ...@@ -236,6 +236,7 @@ extern const char kChromeUICrostiniUpgraderUrl[];
extern const char kChromeUICryptohomeHost[]; extern const char kChromeUICryptohomeHost[];
extern const char kChromeUIDeviceEmulatorHost[]; extern const char kChromeUIDeviceEmulatorHost[];
extern const char kChromeUIDiscoverURL[]; extern const char kChromeUIDiscoverURL[];
extern const char kChromeUIFileManagerHost[];
extern const char kChromeUIFirstRunHost[]; extern const char kChromeUIFirstRunHost[];
extern const char kChromeUIFirstRunURL[]; extern const char kChromeUIFirstRunURL[];
extern const char kChromeUIIntenetConfigDialogURL[]; extern const char kChromeUIIntenetConfigDialogURL[];
......
...@@ -56,7 +56,6 @@ group("closure_compile") { ...@@ -56,7 +56,6 @@ group("closure_compile") {
if (!is_official_build) { if (!is_official_build) {
deps += [ deps += [
"//chromeos/components/file_manager/resources:closure_compile",
"//chromeos/components/sample_system_web_app_ui:closure_compile", "//chromeos/components/sample_system_web_app_ui:closure_compile",
"//chromeos/components/telemetry_extension_ui:closure_compile", "//chromeos/components/telemetry_extension_ui:closure_compile",
] ]
......
# Copyright 2020 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.
import("//mojo/public/tools/bindings/mojom.gni")
assert(is_chromeos, "File Manager is Chrome OS only")
assert(!is_official_build, "File Manager is only built for unofficial builds")
mojom("file_manager_mojom") {
sources = [ "file_manager.mojom" ]
}
static_library("file_manager_ui") {
sources = [
"file_manager_page_handler.cc",
"file_manager_page_handler.h",
"file_manager_ui.cc",
"file_manager_ui.h",
"url_constants.cc",
"url_constants.h",
]
deps = [
":file_manager_mojom",
"//chromeos/constants",
"//chromeos/resources:file_manager_resources",
"//content/public/browser",
"//ui/webui",
]
}
include_rules = [
# Do not add chrome here (use a delegate instead).
"+chromeos/grit/chromeos_file_manager_resources.h",
"+content/public/browser",
"+ui/webui",
]
<?xml version="1.0" encoding="UTF-8"?>
<grit latest_public_release="0" current_release="1" output_all_resource_defines="false">
<outputs>
<output filename="grit/chromeos_file_manager_resources.h" type="rc_header">
<emit emit_type='prepend'></emit>
</output>
<output filename="grit/chromeos_file_manager_resources_map.cc"
type="resource_file_map_source" />
<output filename="grit/chromeos_file_manager_resources_map.h"
type="resource_map_header" />
<output filename="chromeos_file_manager_resources.pak" type="data_package" />
</outputs>
<release seq="1">
<includes>
<if expr="is_official_build == false">
<!-- Privileged app host contents. -->
<include name="IDR_FILE_MANAGER_BROWSER_PROXY_JS" file="browser_proxy.js" type="BINDATA" />
<include name="IDR_FILE_MANAGER_FILE_MANAGER_HTML" file="file_manager.html" type="BINDATA" />
<include name="IDR_FILE_MANAGER_FILE_MANAGER_CSS" file="file_manager.css" type="BINDATA" />
<include name="IDR_FILE_MANAGER_FILE_MANAGER_JS" file="file_manager.js" type="BINDATA" />
<include name="IDR_FILE_MANAGER_ICON_192" file="icon192.png" type="BINDATA" />
<!-- Mojo resources -->
<include name="IDR_FILE_MANAGER_MOJO_LITE_JS"
file="$root_gen_dir\chromeos\components\file_manager\file_manager.mojom-lite.js"
use_base_dir="false"
type="BINDATA" />
</if>
</includes>
</release>
</grit>
// Copyright 2020 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.
#include "chromeos/components/file_manager/url_constants.h"
namespace chromeos {
namespace file_manager {
constexpr char kChromeUIFileManagerHost[] = "file-manager";
constexpr char kChromeUIFileManagerURL[] = "chrome://file-manager";
} // namespace file_manager
} // namespace chromeos
// Copyright 2020 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.
#ifndef CHROMEOS_COMPONENTS_FILE_MANAGER_URL_CONSTANTS_H_
#define CHROMEOS_COMPONENTS_FILE_MANAGER_URL_CONSTANTS_H_
namespace chromeos {
namespace file_manager {
extern const char kChromeUIFileManagerHost[];
extern const char kChromeUIFileManagerURL[];
} // namespace file_manager
} // namespace chromeos
#endif // CHROMEOS_COMPONENTS_FILE_MANAGER_URL_CONSTANTS_H_
...@@ -66,29 +66,6 @@ grit("camera_app_resources") { ...@@ -66,29 +66,6 @@ grit("camera_app_resources") {
] ]
} }
# Resources used by chrome://file-manager
grit("file_manager_resources") {
source = "../components/file_manager/resources/file_manager_resources.grd"
outputs = [
"grit/chromeos_file_manager_resources.h",
"grit/chromeos_file_manager_resources_map.cc",
"grit/chromeos_file_manager_resources_map.h",
"chromeos_file_manager_resources.pak",
]
output_dir = "$root_gen_dir/chromeos"
grit_flags = [
"-E",
"root_gen_dir=" + rebase_path(root_gen_dir, root_build_dir),
]
deps = [
"//chromeos/components/file_manager:file_manager_mojom_js",
"//mojo/public/js:bindings_lite",
]
}
# Resources used by chrome://help-app, and parts of the sandboxed app it hosts # Resources used by chrome://help-app, and parts of the sandboxed app it hosts
# that do not come from the app bundle (below). # that do not come from the app bundle (below).
grit("help_app_resources") { grit("help_app_resources") {
......
...@@ -328,9 +328,6 @@ ...@@ -328,9 +328,6 @@
"chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd": { "chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd": {
"includes": [2517], "includes": [2517],
}, },
"chromeos/components/file_manager/resources/file_manager_resources.grd": {
"includes": [2518],
},
"chromeos/components/help_app_ui/resources/help_app_resources.grd": { "chromeos/components/help_app_ui/resources/help_app_resources.grd": {
"includes": [2520], "includes": [2520],
}, },
......
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