Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: extensions/renderer/api_binding_hooks_delegate.h

Issue 2947463002: [Extensions Bindings] Add a bindings/ subdirectory under renderer (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 #ifndef EXTENSIONS_RENDERER_API_BINDING_HOOKS_DELEGATE_H_
6 #define EXTENSIONS_RENDERER_API_BINDING_HOOKS_DELEGATE_H_
7
8 #include "extensions/renderer/api_binding_hooks.h"
9 #include "extensions/renderer/api_binding_types.h"
10 #include "v8/include/v8.h"
11
12 namespace extensions {
13 class APITypeReferenceMap;
14
15 // A per-API set of custom hooks to override the default behavior.
16 class APIBindingHooksDelegate {
17 public:
18 virtual ~APIBindingHooksDelegate();
19
20 // Allows custom implementations to return a different event object.
21 // Populates |event_out| and returns true if a custom implementation should
22 // be used, otherwise returns false.
23 virtual bool CreateCustomEvent(v8::Local<v8::Context> context,
24 const binding::RunJSFunctionSync& run_js_sync,
25 const std::string& event_name,
26 v8::Local<v8::Value>* event_out);
27
28 // Allows custom implementations to handle a given request.
29 virtual APIBindingHooks::RequestResult HandleRequest(
30 const std::string& method_name,
31 const APISignature* signature,
32 v8::Local<v8::Context> context,
33 std::vector<v8::Local<v8::Value>>* arguments,
34 const APITypeReferenceMap& refs);
35
36 // Allows custom implementations to add additional properties or types to an
37 // API object.
38 virtual void InitializeTemplate(v8::Isolate* isolate,
39 v8::Local<v8::ObjectTemplate> object_template,
40 const APITypeReferenceMap& type_refs) {}
41 };
42
43 } // namespace extensions
44
45 #endif // EXTENSIONS_RENDERER_API_BINDING_HOOKS_DELEGATE_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding_hooks.cc ('k') | extensions/renderer/api_binding_hooks_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698