forked from cretz/qt_cef_poc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cef_handler.h
41 lines (31 loc) · 1.11 KB
/
cef_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef QT_CEF_POC_HANDLER_H_
#define QT_CEF_POC_HANDLER_H_
#include <QtWidgets>
#include "include/cef_client.h"
class CefHandler :
public CefClient,
public CefDisplayHandler,
public CefFocusHandler {
public:
explicit CefHandler(QPointer<QMainWindow> main_win,
QPointer<QLineEdit> url_line_edit,
QPointer<QWidget> browser_widg);
virtual CefRefPtr<CefDisplayHandler> GetDisplayHandler() override {
return this;
}
virtual CefRefPtr<CefFocusHandler> GetFocusHandler() override {
return this;
}
virtual void OnTitleChange(CefRefPtr<CefBrowser> browser,
const CefString& title) override;
virtual void OnAddressChange(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const CefString& url) override;
virtual void OnGotFocus(CefRefPtr<CefBrowser> browser) override;
private:
QPointer<QMainWindow> main_win_;
QPointer<QLineEdit> url_line_edit_;
QPointer<QWidget> browser_widg_;
IMPLEMENT_REFCOUNTING(CefHandler);
};
#endif // QT_CEF_POC_HANDLER_H_