chromium/extensions/renderer/bindings/declarative_event.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Builds an ArgumentSpec that accepts the given |choices| as references.
std::unique_ptr<ArgumentSpec> BuildChoicesSpec(
    const std::vector<std::string>& choices_list) {}

// Builds the ArgumentSpec for a events.Rule type, given a list of actions and
// conditions. It's insufficient to use the specification in events.Rule, since
// that provides argument types of "any" for actions and conditions, allowing
// individual APIs to specify them further. Alternatively, we could lookup the
// events.Rule spec and only override the actions and conditions properties,
// but that doesn't seem any less contrived and requires JSON parsing and
// complex spec initialization.
// TODO(devlin): Another target for generating these specs. Currently, the
// custom JS bindings do something similar, so this is no worse off, but that
// doesn't make it more desirable.
std::unique_ptr<ArgumentSpec> BuildRulesSpec(
    const std::vector<std::string>& actions_list,
    const std::vector<std::string>& conditions_list) {}

// Builds the signature for events.addRules using a specific rule.
std::unique_ptr<APISignature> BuildAddRulesSignature(
    const std::string& rule_name) {}

}  // namespace

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) {}

}  // namespace extensions