aboutsummaryrefslogtreecommitdiff
path: root/src/WindowMediator.cpp
blob: df81f9fb4a70d8efa1e6d9b5a910288a6a82b6b5 (plain) (blame)
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
#include <QList>
#include <QWidget>
#include <QtCore>

#include "WindowMediator.hpp"
#include "widgets/WebViewStack.hpp"

WindowMediator::WindowMediator(WebViewStack *webview_stack)
    : webview_stack(webview_stack) {
  connect(this, &WindowMediator::history_back_requested, webview_stack,
          &WebViewStack::webview_history_back);
  connect(this, &WindowMediator::history_forward_requested, webview_stack,
          &WebViewStack::webview_history_forward);

  connect(this, &WindowMediator::url_opened, webview_stack,
          &WebViewStack::open_url);
  connect(this, &WindowMediator::webview_closed, webview_stack,
          &WebViewStack::close);
  connect(this, &WindowMediator::webview_selected, webview_stack,
          &WebViewStack::focus_webview);
}

WindowMediator::~WindowMediator() {
  disconnect(this);
  delete webview_stack;
}