nim_duilib/ui_components/cef_control/app/js_handler.h
jiajia_deng 4933d1f2bc Remove dependency on shared
Signed-off-by: jiajia_deng <2894220@gmail.com>
2019-09-20 16:27:58 +08:00

29 lines
734 B
C++

/** @file js_handler.h
* @brief 定义一个C++与JS进行交互的JsHandler类
* @copyright (c) 2016, NetEase Inc. All rights reserved
* @author Redrain
* @date 2016/7/19
*/
#pragma once
#include "include/cef_base.h"
#include "include/cef_app.h"
#include "cef_control/app/cef_js_bridge.h"
namespace nim_cef
{
class CefJSHandler : public CefV8Handler
{
public:
CefJSHandler() {}
virtual bool Execute(const CefString& name, CefRefPtr<CefV8Value> object, const CefV8ValueList& arguments, CefRefPtr<CefV8Value>& retval, CefString& exception) OVERRIDE;
void AttachJSBridge(std::shared_ptr<CefJSBridge> js_bridge) { js_bridge_ = js_bridge; }
IMPLEMENT_REFCOUNTING(CefJSHandler);
private:
std::shared_ptr<CefJSBridge> js_bridge_;
};
}