mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-27 03:14:15 +00:00
45 lines
1 KiB
C++
45 lines
1 KiB
C++
|
|
/*
|
||
|
|
* Copyright (c) 2025, Tim Flynn <trflynn89@ladybird.org>
|
||
|
|
*
|
||
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
||
|
|
*/
|
||
|
|
|
||
|
|
#include <AK/JsonArray.h>
|
||
|
|
#include <AK/JsonObject.h>
|
||
|
|
#include <LibDevTools/Actors/LayoutInspectorActor.h>
|
||
|
|
|
||
|
|
namespace DevTools {
|
||
|
|
|
||
|
|
NonnullRefPtr<LayoutInspectorActor> LayoutInspectorActor::create(DevToolsServer& devtools, String name)
|
||
|
|
{
|
||
|
|
return adopt_ref(*new LayoutInspectorActor(devtools, move(name)));
|
||
|
|
}
|
||
|
|
|
||
|
|
LayoutInspectorActor::LayoutInspectorActor(DevToolsServer& devtools, String name)
|
||
|
|
: Actor(devtools, move(name))
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
LayoutInspectorActor::~LayoutInspectorActor() = default;
|
||
|
|
|
||
|
|
void LayoutInspectorActor::handle_message(StringView type, JsonObject const&)
|
||
|
|
{
|
||
|
|
JsonObject response;
|
||
|
|
|
||
|
|
if (type == "getCurrentFlexbox"sv) {
|
||
|
|
response.set("flexbox"sv, JsonValue {});
|
||
|
|
send_message(move(response));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if (type == "getGrids"sv) {
|
||
|
|
response.set("grids"sv, JsonArray {});
|
||
|
|
send_message(move(response));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
send_unrecognized_packet_type_error(type);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|