mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
18 lines
510 B
C++
18 lines
510 B
C++
|
#include "WindowSize.h"
|
||
|
#include "WebPage.h"
|
||
|
#include "WebPageManager.h"
|
||
|
#include "JsonSerializer.h"
|
||
|
|
||
|
WindowSize::WindowSize(WebPageManager *manager, QStringList &arguments, QObject *parent) : WindowCommand(manager, arguments, parent) {
|
||
|
}
|
||
|
|
||
|
void WindowSize::windowFound(WebPage *page) {
|
||
|
QSize size = page->viewportSize();
|
||
|
QVariantList elements;
|
||
|
elements << size.width();
|
||
|
elements << size.height();
|
||
|
JsonSerializer serializer;
|
||
|
QByteArray json = serializer.serialize(elements);
|
||
|
finish(true, json);
|
||
|
}
|