forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Files app] Separate chrome-untrusted resources
The resources in u/f/file_manager/foreground/elements/sandboxed/ are meant to be loaded in a safe environment with restricted permissions (either <webview> or an iframed chrome-untrusted page). Separate these resources from the main ui/file_manager code to better reflect the fact that chrome-untrusted://file-manager is now its own separate page with its own resources. Legacy Files app now "borrows" these resources from the chrome-untrusted WebUI, to load them in <webview> tags. This code is meant to be removed once Files app fully migrates to a SWA. Test: browser_tests --gtest_filter=QuickView/FilesAppBrowserTest.Test/* Bug: b:192894681, b:201363705, b:197601728 Change-Id: I3490672beb5a72d814cd5fb8c7d908fe8678472d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3189577 Reviewed-by: calamity <calamity@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Luciano Pacheco <lucmult@chromium.org> Reviewed-by: Bo Majewski <majewski@chromium.org> Commit-Queue: Jeremie Boulic <jboulic@chromium.org> Cr-Commit-Position: refs/heads/main@{#930868}
- Loading branch information
Jérémie Boulic
authored and
Chromium LUCI CQ
committed
Oct 13, 2021
1 parent
f83005f
commit 2288a6b
Showing
25 changed files
with
101 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Copyright 2021 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("//third_party/closure_compiler/compile_js.gni") | ||
import("//tools/grit/grit_rule.gni") | ||
import("//ui/webui/resources/tools/generate_grd.gni") | ||
|
||
js_library("files_media_content") { | ||
externs_list = [ "//ui/file_manager/file_manager/externs/quick_view.js" ] | ||
} | ||
|
||
js_type_check("closure_compile") { | ||
deps = [ ":files_media_content" ] | ||
} | ||
|
||
generated_untrusted_grd = "$target_gen_dir/file_manager_untrusted_resources.grd" | ||
|
||
generate_grd("build_file_manager_untrusted_grd") { | ||
grd_prefix = "file_manager_untrusted" | ||
out_grd = generated_untrusted_grd | ||
|
||
input_files_base_dir = rebase_path(".", "//") | ||
input_files = [ | ||
"files_audio_content.css", | ||
"files_audio_content.html", | ||
"files_text_content.css", | ||
"files_text_content.html", | ||
"files_img_content.css", | ||
"files_img_content.html", | ||
"files_media_content.js", | ||
"files_video_content.css", | ||
"files_video_content.html", | ||
] | ||
resource_path_rewrites = [ | ||
"files_audio_content.css|untrusted_resources/files_audio_content.css", | ||
"files_audio_content.html|untrusted_resources/files_audio_content.html", | ||
"files_text_content.css|untrusted_resources/files_text_content.css", | ||
"files_text_content.html|untrusted_resources/files_text_content.html", | ||
"files_img_content.css|untrusted_resources/files_img_content.css", | ||
"files_img_content.html|untrusted_resources/files_img_content.html", | ||
"files_media_content.js|untrusted_resources/files_media_content.js", | ||
"files_video_content.css|untrusted_resources/files_video_content.css", | ||
"files_video_content.html|untrusted_resources/files_video_content.html", | ||
] | ||
} | ||
|
||
# Resources used by chrome-untrusted://file-manager. | ||
grit("file_manager_untrusted_resources") { | ||
# These arguments are needed since the grd is generated at build time. | ||
enable_input_discovery_for_gn_analyze = false | ||
|
||
source = generated_untrusted_grd | ||
deps = [ ":build_file_manager_untrusted_grd" ] | ||
|
||
outputs = [ | ||
"grit/file_manager_untrusted_resources.h", | ||
"grit/file_manager_untrusted_resources_map.cc", | ||
"grit/file_manager_untrusted_resources_map.h", | ||
"file_manager_untrusted_resources.pak", | ||
] | ||
output_dir = target_gen_dir | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...elements/sandboxed/files_media_content.js → ...ntrusted_resources/files_media_content.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ui/file_manager/file_manager/foreground/elements/files_quick_view.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
9 changes: 4 additions & 5 deletions
9
ui/file_manager/file_manager/foreground/elements/files_safe_media.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
ui/file_manager/file_manager/foreground/elements/sandboxed/BUILD.gn
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters