Commit 80d9e977 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Remove all uses of Platform::Current()->GetDataResource in ValidationMessageOverlayDelegate

As a step to reduce uses of Platform::Current()->GetDataResource,
this CL replaces all uses of Platform::Current()->GetDataResource
with UncompressResourceAsBinary.

Bug: 983396
Change-Id: Ia6460f2e52a6ebd91bf07143f63ec2ac572f6efa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1743293Reviewed-by: default avatarKent Tamura <tkent@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#685108}
parent 7a205981
......@@ -468,10 +468,6 @@ const DataResource kDataResources[] = {
ui::SCALE_FACTOR_NONE, true},
{"DocumentXMLTreeViewer.js", IDR_DOCUMENTXMLTREEVIEWER_JS,
ui::SCALE_FACTOR_NONE, true},
{"input_alert.svg", IDR_VALIDATION_BUBBLE_ICON, ui::SCALE_FACTOR_NONE,
true},
{"validation_bubble.css", IDR_VALIDATION_BUBBLE_CSS, ui::SCALE_FACTOR_NONE,
true},
{"placeholderIcon", IDR_PLACEHOLDER_ICON, ui::SCALE_FACTOR_100P, false},
{"brokenCanvas", IDR_BROKENCANVAS, ui::SCALE_FACTOR_100P, false},
{"brokenCanvas@2x", IDR_BROKENCANVAS, ui::SCALE_FACTOR_200P, false},
......
......@@ -7,6 +7,7 @@
#include <memory>
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/resources/grit/blink_resources.h"
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/events/event_dispatch_forbidden_scope.h"
......@@ -16,6 +17,7 @@
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/core/page/page_popup_client.h"
#include "third_party/blink/renderer/platform/data_resource_helper.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/drawing_recorder.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
......@@ -198,7 +200,7 @@ void ValidationMessageOverlayDelegate::CreatePage(const FrameOverlay& overlay) {
void ValidationMessageOverlayDelegate::WriteDocument(SharedBuffer* data) {
DCHECK(data);
PagePopupClient::AddString("<!DOCTYPE html><html><head><style>", data);
data->Append(Platform::Current()->GetDataResource("validation_bubble.css"));
data->Append(UncompressResourceAsBinary(IDR_VALIDATION_BUBBLE_CSS));
PagePopupClient::AddString("</style></head>", data);
PagePopupClient::AddString(
Locale::DefaultLocale().IsRTL() ? "<body dir=rtl>" : "<body dir=ltr>",
......@@ -210,7 +212,7 @@ void ValidationMessageOverlayDelegate::WriteDocument(SharedBuffer* data) {
"<div id=spacer-top></div>"
"<main id=bubble-body>",
data);
data->Append(Platform::Current()->GetDataResource("input_alert.svg"));
data->Append(UncompressResourceAsBinary(IDR_VALIDATION_BUBBLE_ICON));
PagePopupClient::AddString(message_dir_ == TextDirection::kLtr
? "<div dir=ltr id=main-message></div>"
: "<div dir=rtl id=main-message></div>",
......
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