// Application headers.
#include "PrivacyWebEngineView.h"
#include "databases/CookiesDatabase.h"
+#include "windows/BrowserWindow.h"
// Construct the class.
PrivacyWebEngineView::PrivacyWebEngineView() : QWebEngineView(nullptr) {}
emit updateCookiesAction(cookieListPointer->size());
}
+QWebEngineView* PrivacyWebEngineView::createWindow(QWebEnginePage::WebWindowType webWindowType) {
+ qDebug().noquote().nospace() << "Web window type: " << webWindowType;
+
+ // Get a handle for the browser window.
+ BrowserWindow *browserWindowPointer = qobject_cast<BrowserWindow*>(window());
+
+ // Create the requsted window type.
+ switch (webWindowType) {
+ case QWebEnginePage::WebBrowserTab: {
+ // Create the new tab and return the privacy WebEngine view pointer. It will then be populated with the link from the context menu.
+ return browserWindowPointer->tabWidgetPointer->addTab();
+ }
+
+ default: {
+ // Return an null pointer.
+ return nullptr;
+ }
+ }
+}
+
void PrivacyWebEngineView::removeCookieFromList(const QNetworkCookie &cookie) const
{
//qDebug() << "Remove cookie: " << cookie.toRawForm();