nim_duilib/ui_components/cef_control/app/js_handler.h
jiajia_deng ad9a6b3edc Modified the namespace of the UI component
Signed-off-by: jiajia_deng <2894220@gmail.com>
2019-09-22 11:08:20 +08:00

29 lines
735 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_comp
{
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_;
};
}