blob: 0d9c6cc874207640de79fc76273b1d852319f84d [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
#include "base/macros.h"
#include "extensions/renderer/bindings/argument_spec.h"
#include "gin/wrappable.h"
#include "v8/include/v8.h"
namespace base {
class ListValue;
namespace gin {
class Arguments;
namespace extensions {
class APIEventHandler;
class APIRequestHandler;
class BindingAccessChecker;
// A stub object for the EasyUnlockProxmityRequired object. This only needs to
// support a single property, an event for 'onChange' (which will never be
// triggered).
// TODO(devlin): Remove this once the preferencesPrivate API is fully removed.
class EasyUnlockProximityRequiredStub final
: public gin::Wrappable<EasyUnlockProximityRequiredStub> {
~EasyUnlockProximityRequiredStub() override;
static v8::Local<v8::Object> Create(
v8::Isolate* isolate,
const std::string& property_name,
const base::ListValue* property_values,
APIRequestHandler* request_handler,
APIEventHandler* event_handler,
APITypeReferenceMap* type_refs,
const BindingAccessChecker* access_checker);
static gin::WrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
EasyUnlockProximityRequiredStub(APIEventHandler* event_handler);
// Returns the onChange event.
v8::Local<v8::Value> GetOnChangeEvent(gin::Arguments* arguments);
// The binding system's event handler; guaranteed to outlive this object.
APIEventHandler* const event_handler_;
} // namespace extensions