2019-04-19 17:19:57 +08:00
|
|
|
|
/** @file js_handler.h
|
|
|
|
|
* @brief <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>C++<EFBFBD><EFBFBD>JS<EFBFBD><EFBFBD><EFBFBD>н<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>JsHandler<EFBFBD><EFBFBD>
|
|
|
|
|
* @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"
|
|
|
|
|
|
2019-09-22 11:08:20 +08:00
|
|
|
|
namespace nim_comp
|
2019-04-19 17:19:57 +08:00
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
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_;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|