Add the ability to code generated prepopulated static nested structs
[chromium-blink-merge.git] / extensions / renderer / script_injection_callback.h
blob14819277cbd711ad741e184c7941f3b34c8f6704
1 // Copyright 2015 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_SCRIPT_INJECTION_CALLBACK_H_
6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTION_CALLBACK_H_
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "third_party/WebKit/public/web/WebScriptExecutionCallback.h"
11 #include "v8/include/v8.h"
13 namespace blink {
14 template<typename T> class WebVector;
17 namespace extensions {
19 // A wrapper around a callback to notify a script injection when injection
20 // completes.
21 // This class manages its own lifetime.
22 class ScriptInjectionCallback : public blink::WebScriptExecutionCallback {
23 public:
24 using CompleteCallback =
25 base::Callback<void(
26 const blink::WebVector<v8::Local<v8::Value>>& result)>;
28 ScriptInjectionCallback(const CompleteCallback& injection_completed_callback);
29 ~ScriptInjectionCallback() override;
31 void completed(
32 const blink::WebVector<v8::Local<v8::Value> >& result) override;
34 private:
35 CompleteCallback injection_completed_callback_;
37 DISALLOW_COPY_AND_ASSIGN(ScriptInjectionCallback);
40 } // namespace extensions
42 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTION_CALLBACK_H_