Commit f00cf779 authored by Alex Rudenko's avatar Alex Rudenko Committed by Commit Bot

Revert "[DevTools]: Remove highlight tool and use new resources from DevTools"

This reverts commit 176ec212.

Reason for revert: the overlay seems broken on master, I'd like to revert to see if the merge caused it

Original change's description:
> [DevTools]: Remove highlight tool and use new resources from DevTools
> 
> This CL removes inspect_tool_highlight.html and replaces it with
> resources produced by DevTools[1], where the implementation has been
> moved to in a separate CL[2].
> 
> [1]: https://goo.gle/devtools-overlay-reuse
> [2]: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2192892
> 
> Bug: 1078267
> Change-Id: I95d3faef98470e13430ed251cf135e59269358d1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2194865
> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Peter Marshall <petermarshall@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#774030}

TBR=thakis@chromium.org,gbiv@chromium.org,petermarshall@chromium.org,jochen@chromium.org,blundell@google.com,mathias@chromium.org,alexrudenko@chromium.org

Change-Id: I8b5b97d040e15b80441295ebe96e5b408f73bb72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1078267
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2225718Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774055}
parent 42ed4b41
......@@ -1054,7 +1054,6 @@ if (!is_ios) {
"//skia/public/mojom:mojom_js_data_deps",
"//testing/buildbot/filters:blink_web_tests_filter",
"//third_party/blink/public:blink_devtools_frontend_resources_files",
"//third_party/blink/public:blink_devtools_inspector_resources",
"//third_party/blink/public/mojom:mojom_platform_js_data_deps",
"//third_party/blink/renderer/core/html:js_files_for_form_controls_web_tests",
"//third_party/catapult/third_party/typ",
......
......@@ -802,7 +802,6 @@ if (is_win) {
# creating or destroying the symlink.
":chrome_app",
"//third_party/blink/public:blink_devtools_frontend_resources",
"//third_party/blink/public:blink_devtools_inspector_resources",
]
}
} else {
......@@ -1262,7 +1261,6 @@ group("child_dependencies") {
"//pdf",
"//services/tracing/public/cpp",
"//third_party/blink/public:blink_devtools_frontend_resources",
"//third_party/blink/public:blink_devtools_inspector_resources",
]
if (enable_nacl) {
......
......@@ -99,7 +99,6 @@ template("chrome_extra_paks") {
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
]
deps = [
......@@ -112,7 +111,6 @@ template("chrome_extra_paks") {
"//content/browser/tracing:resources",
"//mojo/public/js:resources",
"//net:net_resources",
"//third_party/blink/public:devtools_inspector_resources",
"//third_party/blink/public:resources",
"//ui/resources",
]
......
......@@ -674,7 +674,6 @@ repack("pak") {
"$root_gen_dir/net/net_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_100_percent.pak",
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
"$root_gen_dir/third_party/blink/public/strings/blink_strings_en-US.pak",
"$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
"$root_gen_dir/ui/resources/webui_resources.pak",
......@@ -692,7 +691,6 @@ repack("pak") {
"//content/browser/webrtc/resources",
"//mojo/public/js:resources",
"//net:net_resources",
"//third_party/blink/public:devtools_inspector_resources",
"//third_party/blink/public:resources",
"//third_party/blink/public:scaled_resources_100_percent",
"//third_party/blink/public/strings",
......
......@@ -421,7 +421,6 @@ source_set("blink_headers") {
]
public_deps = [
":devtools_inspector_resources_grit",
":resources_grit",
"//net",
"//services/service_manager/public/cpp",
......@@ -462,10 +461,6 @@ group("blink_devtools_frontend_resources") {
public_deps = [ "$devtools_frontend_path:devtools_frontend_resources" ]
}
group("blink_devtools_inspector_resources") {
public_deps = [ ":devtools_inspector_resources_grit" ]
}
group("blink_devtools_frontend_resources_files") {
testonly = true
data_deps = [ "$devtools_frontend_path:devtools_all_files" ]
......@@ -486,25 +481,6 @@ grit("resources") {
]
}
grit("devtools_inspector_resources") {
# Required because the .grd is generated.
enable_input_discovery_for_gn_analyze = false
source = "$root_out_dir/resources/inspector_overlay/inspector_overlay_resources.grd"
output_dir = resources_out_dir
outputs = [
"grit/inspector_overlay_resources_map.h",
"inspector_overlay_resources.pak",
]
defines =
[ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_out_dir, root_build_dir) ]
deps = [
"$devtools_frontend_path:generate_devtools_inspector_overlay_resources",
]
}
grit("image_resources") {
output_dir = resources_out_dir
source = "blink_image_resources.grd"
......
......@@ -34,6 +34,7 @@
<include name="IDR_INSPECT_TOOL_COMMON_JS" file="../renderer/core/inspector/inspect_tool_common.js" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_COMMON_CSS" file="../renderer/core/inspector/inspect_tool_common.css" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_DISTANCES_HTML" file="../renderer/core/inspector/inspect_tool_distances.html" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_HIGHLIGHT_HTML" file="../renderer/core/inspector/inspect_tool_highlight.html" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_PAUSED_HTML" file="../renderer/core/inspector/inspect_tool_paused.html" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_VIEWPORT_SIZE_HTML" file="../renderer/core/inspector/inspect_tool_viewport_size.html" type="BINDATA" compress="gzip"/>
<include name="IDR_INSPECT_TOOL_SCREENSHOT_HTML" file="../renderer/core/inspector/inspect_tool_screenshot.html" type="BINDATA" compress="gzip"/>
......
......@@ -39,7 +39,6 @@
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/resources/grit/blink_resources.h"
#include "third_party/blink/public/resources/grit/inspector_overlay_resources_map.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/renderer/bindings/core/v8/sanitize_script_errors.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
......@@ -121,7 +120,7 @@ void InspectTool::Init(InspectorOverlayAgent* overlay,
}
int InspectTool::GetDataResourceId() {
return IDR_INSPECT_TOOL_HIGHLIGHT_JS;
return IDR_INSPECT_TOOL_HIGHLIGHT_HTML;
}
bool InspectTool::HandleInputEvent(LocalFrameView* frame_view,
......@@ -224,7 +223,7 @@ Hinge::Hinge(FloatQuad quad,
int Hinge::GetDataResourceId() {
// TODO (soxia): In the future, we should make the hinge working properly
// with tools using different resources.
return IDR_INSPECT_TOOL_HIGHLIGHT_JS;
return IDR_INSPECT_TOOL_HIGHLIGHT_HTML;
}
void Hinge::Trace(Visitor* visitor) const {
......@@ -1016,25 +1015,13 @@ void InspectorOverlayAgent::LoadFrameForTool(int data_resource_id) {
frame->View()->SetBaseBackgroundColor(Color::kTransparent);
scoped_refptr<SharedBuffer> data = SharedBuffer::Create();
// TODO(crbug.com/1078267): migrate all inspector tools
if (frame_resource_name_ == IDR_INSPECT_TOOL_HIGHLIGHT_JS) {
// New source of overlay resources.
data->Append("<style>", static_cast<size_t>(7));
data->Append(UncompressResourceAsBinary(IDR_INSPECT_COMMON_CSS));
data->Append("</style>", static_cast<size_t>(8));
data->Append("<script>", static_cast<size_t>(8));
data->Append(UncompressResourceAsBinary(frame_resource_name_));
data->Append("</script>", static_cast<size_t>(9));
} else {
// Old source of resources.
data->Append("<style>", static_cast<size_t>(7));
data->Append(UncompressResourceAsBinary(IDR_INSPECT_TOOL_COMMON_CSS));
data->Append("</style>", static_cast<size_t>(8));
data->Append("<script>", static_cast<size_t>(8));
data->Append(UncompressResourceAsBinary(IDR_INSPECT_TOOL_COMMON_JS));
data->Append("</script>", static_cast<size_t>(9));
data->Append(UncompressResourceAsBinary(frame_resource_name_));
}
data->Append("<style>", static_cast<size_t>(7));
data->Append(UncompressResourceAsBinary(IDR_INSPECT_TOOL_COMMON_CSS));
data->Append("</style>", static_cast<size_t>(8));
data->Append("<script>", static_cast<size_t>(8));
data->Append(UncompressResourceAsBinary(IDR_INSPECT_TOOL_COMMON_JS));
data->Append("</script>", static_cast<size_t>(9));
data->Append(UncompressResourceAsBinary(frame_resource_name_));
frame->ForceSynchronousDocumentInstall("text/html", data);
......
......@@ -603,16 +603,10 @@
# This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/devtools/devtools_resources.grd": {
"META": {"sizes": {"includes": [1000],}},
"META": {"sizes": {"includes": [500],}},
"includes": [3860],
},
# This file is generated during the build.
"<(SHARED_INTERMEDIATE_DIR)/resources/inspector_overlay/inspector_overlay_resources.grd": {
"META": {"sizes": {"includes": [50],}},
"includes": [3880],
},
# END "everything else" section.
# Everything but chrome/, components/, content/, and ios/
......
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