马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 KenTien 于 2025-3-11 08:27 编辑
[C++] 查看源码 复制代码 // Client handler abstract base class. Provides common functionality shared by
// all concrete client handler implementations.
class ClientHandler : public CefClient,
public CefLifeSpanHandler//包含这个
{
// CefClient methods
CefRefPtr<CefLifeSpanHandler> GetLifeSpanHandler() override { return this; }
// CefLifeSpanHandler methods
virtual bool OnBeforePopup(CefRefPtr< CefBrowser > browser,
CefRefPtr< CefFrame > frame,
const CefString& target_url,
const CefString& target_frame_name,
WindowOpenDisposition target_disposition,
bool user_gesture,
const CefPopupFeatures& popupFeatures,
CefWindowInfo& windowInfo,
CefRefPtr< CefClient >& client,
CefBrowserSettings& settings,
CefRefPtr< CefDictionaryValue >& extra_info,
bool* no_javascript_access
) override;
// 实现
bool ClientHandler::OnBeforePopup(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, const CefString& target_url, const CefString& target_frame_name, WindowOpenDisposition target_disposition, bool user_gesture, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr<CefClient>& client, CefBrowserSettings& settings, CefRefPtr<CefDictionaryValue>& extra_info, bool* no_javascript_access)
{
browser->GetMainFrame()->LoadURL(target_url);
return true;
}
|