diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-26 11:59:38 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-26 11:59:38 +0530 |
| commit | 2078c60477842d7cf6991148e23979565737a8b5 (patch) | |
| tree | 980e2aea150e85c6b87f2b521fce1006486244d8 /src/widgets/BrowserWindow.cpp | |
| parent | 68448538172663279919b29dd09b5faa51e0628a (diff) | |
| download | null-browser-2078c60477842d7cf6991148e23979565737a8b5.tar.gz null-browser-2078c60477842d7cf6991148e23979565737a8b5.zip | |
Refactor heavy + extras.tabline module (incomplete)
Diffstat (limited to 'src/widgets/BrowserWindow.cpp')
| -rw-r--r-- | src/widgets/BrowserWindow.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/widgets/BrowserWindow.cpp b/src/widgets/BrowserWindow.cpp index fe2285b..f97f397 100644 --- a/src/widgets/BrowserWindow.cpp +++ b/src/widgets/BrowserWindow.cpp @@ -23,7 +23,7 @@ BrowserWindow::BrowserWindow(const Configuration &configuration, QWebEngineProfi layout->setSpacing(0); centralWidget()->setLayout(layout); - // Stack of web views + // Stack of web views + decorations webview_stack = new WebViewStack(&configuration, profile, this); decorations = new Decorations(webview_stack, profile, this); layout->addWidget(decorations); @@ -79,3 +79,21 @@ void BrowserWindow::update_permissions_persistance(const QString &persistance) { auto persistance_policy = Configuration::to_permission_persistance_policy(persistance); profile->setPersistentPermissionsPolicy(persistance_policy); } + +IWebViewMediator *BrowserWindow::get_webview_mediator(WebViewId webview_id) { + if (decorations->has_webview(webview_id)) + return decorations; + return webview_stack; +} + +bool BrowserWindow::has_webview(WebViewId webview_id) { + return webview_stack->has_webview(webview_id) || decorations->has_webview(webview_id); +} + +void BrowserWindow::open_url(const QUrl &url, OpenType open_type, WebViewId webview_id) { + get_webview_mediator(webview_id)->open_url(url, open_type, webview_id); +} + +void BrowserWindow::set_html(const QString &html, WebViewId webview_id) { + get_webview_mediator(webview_id)->set_html(html, webview_id); +} |
