#include "third_party/blink/renderer/core/inspector/inspector_audits_agent.h"
#include "base/numerics/safe_conversions.h"
#include "third_party/blink/public/mojom/devtools/inspector_issue.mojom-blink.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/web/web_autofill_client.h"
#include "third_party/blink/public/web/web_image.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/dom_token_list.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html/html_anchor_element.h"
#include "third_party/blink/renderer/core/inspector/identifiers_factory.h"
#include "third_party/blink/renderer/core/inspector/inspector_audits_issue.h"
#include "third_party/blink/renderer/core/inspector/inspector_issue_storage.h"
#include "third_party/blink/renderer/core/inspector/inspector_network_agent.h"
#include "third_party/blink/renderer/core/inspector/protocol/audits.h"
#include "third_party/blink/renderer/platform/graphics/image_data_buffer.h"
#include "third_party/blink/renderer/platform/wtf/text/base64.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/geometry/size.h"
namespace blink {
Maybe;
encoding_enum;
namespace {
static constexpr int kMaximumEncodeImageWidthInPixels = …;
static constexpr int kMaximumEncodeImageHeightInPixels = …;
static constexpr double kDefaultEncodeQuality = …;
bool EncodeAsImage(char* body,
size_t size,
const String& encoding,
const double quality,
Vector<unsigned char>* output) { … }
std::unique_ptr<protocol::Audits::InspectorIssue> CreateLowTextContrastIssue(
const ContrastInfo& info) { … }
}
void InspectorAuditsAgent::Trace(Visitor* visitor) const { … }
InspectorAuditsAgent::InspectorAuditsAgent(
InspectorNetworkAgent* network_agent,
InspectorIssueStorage* storage,
InspectedFrames* inspected_frames,
WebAutofillClient* web_autofill_client)
: … { … }
InspectorAuditsAgent::~InspectorAuditsAgent() = default;
protocol::Response InspectorAuditsAgent::getEncodedResponse(
const String& request_id,
const String& encoding,
Maybe<double> quality,
Maybe<bool> size_only,
Maybe<protocol::Binary>* out_body,
int* out_original_size,
int* out_encoded_size) { … }
void InspectorAuditsAgent::CheckContrastForDocument(Document* document,
bool report_aaa) { … }
protocol::Response InspectorAuditsAgent::checkContrast(
protocol::Maybe<bool> report_aaa) { … }
protocol::Response InspectorAuditsAgent::enable() { … }
protocol::Response InspectorAuditsAgent::checkFormsIssues(
std::unique_ptr<protocol::Array<protocol::Audits::GenericIssueDetails>>*
out_formIssues) { … }
protocol::Response InspectorAuditsAgent::disable() { … }
void InspectorAuditsAgent::Restore() { … }
void InspectorAuditsAgent::InnerEnable() { … }
void InspectorAuditsAgent::InspectorIssueAdded(
protocol::Audits::InspectorIssue* issue) { … }
}