#include "extensions/renderer/bindings/declarative_event.h"
#include <algorithm>
#include <memory>
#include "base/values.h"
#include "extensions/renderer/bindings/api_event_listeners.h"
#include "extensions/renderer/bindings/api_request_handler.h"
#include "extensions/renderer/bindings/api_signature.h"
#include "extensions/renderer/bindings/api_type_reference_map.h"
#include "extensions/renderer/bindings/argument_spec.h"
#include "gin/object_template_builder.h"
#include "gin/per_context_data.h"
namespace extensions {
namespace {
std::unique_ptr<ArgumentSpec> BuildChoicesSpec(
const std::vector<std::string>& choices_list) { … }
std::unique_ptr<ArgumentSpec> BuildRulesSpec(
const std::vector<std::string>& actions_list,
const std::vector<std::string>& conditions_list) { … }
std::unique_ptr<APISignature> BuildAddRulesSignature(
const std::string& rule_name) { … }
}
gin::WrapperInfo DeclarativeEvent::kWrapperInfo = …;
DeclarativeEvent::DeclarativeEvent(
const std::string& name,
APITypeReferenceMap* type_refs,
APIRequestHandler* request_handler,
const std::vector<std::string>& actions_list,
const std::vector<std::string>& conditions_list,
int webview_instance_id)
: … { … }
DeclarativeEvent::~DeclarativeEvent() = default;
gin::ObjectTemplateBuilder DeclarativeEvent::GetObjectTemplateBuilder(
v8::Isolate* isolate) { … }
const char* DeclarativeEvent::GetTypeName() { … }
void DeclarativeEvent::AddRules(gin::Arguments* arguments) { … }
void DeclarativeEvent::RemoveRules(gin::Arguments* arguments) { … }
void DeclarativeEvent::GetRules(gin::Arguments* arguments) { … }
void DeclarativeEvent::HandleFunction(const std::string& signature_name,
const std::string& request_name,
gin::Arguments* arguments) { … }
}