cc: For debugging, show checkerboards with the tile border color
[chromium-blink-merge.git] / extensions / renderer / binding_generating_native_handler.h
blobd4e4b0aa722e030e7869d8b80858a5fa2f2d3bd3
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef EXTENSIONS_RENDERER_BINDING_GENERATING_NATIVE_HANDLER_H_
6 #define EXTENSIONS_RENDERER_BINDING_GENERATING_NATIVE_HANDLER_H_
8 #include <string>
10 #include "base/compiler_specific.h"
11 #include "extensions/renderer/native_handler.h"
13 namespace extensions {
15 class ScriptContext;
17 // Generates API bindings based on the JSON/IDL schemas. This is done by
18 // creating a |Binding| (from binding.js) for the schema and generating the
19 // bindings from that.
20 class BindingGeneratingNativeHandler : public NativeHandler {
21 public:
22 // Generates binding for |api_name|, and sets the |bind_to| property on the
23 // Object returned by |NewInstance| to the generated binding.
24 BindingGeneratingNativeHandler(ScriptContext* context,
25 const std::string& api_name,
26 const std::string& bind_to);
28 v8::Local<v8::Object> NewInstance() override;
30 private:
31 ScriptContext* context_;
32 std::string api_name_;
33 std::string bind_to_;
36 } // namespace extensions
38 #endif // EXTENSIONS_RENDERER_BINDING_GENERATING_NATIVE_HANDLER_H_