2012-03-27 18:49:57 -04:00
|
|
|
#include "GetWindowHandles.h"
|
|
|
|
#include "WebPageManager.h"
|
2012-03-28 23:05:24 -04:00
|
|
|
#include "CommandFactory.h"
|
|
|
|
#include "WebPage.h"
|
2012-12-29 15:58:56 -05:00
|
|
|
#include "JsonSerializer.h"
|
2012-03-27 18:49:57 -04:00
|
|
|
#include <QStringList>
|
|
|
|
|
2012-07-08 15:04:30 -04:00
|
|
|
GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
|
2012-03-27 18:49:57 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetWindowHandles::start() {
|
2012-12-29 15:58:56 -05:00
|
|
|
QVariantList handles;
|
2012-03-27 18:49:57 -04:00
|
|
|
|
2012-04-05 18:49:55 -04:00
|
|
|
foreach(WebPage *page, manager()->pages())
|
2012-12-29 15:58:56 -05:00
|
|
|
handles << page->uuid();
|
2012-03-27 18:49:57 -04:00
|
|
|
|
2012-12-29 15:58:56 -05:00
|
|
|
JsonSerializer serializer;
|
2012-12-30 17:47:16 -05:00
|
|
|
QByteArray json = serializer.serialize(handles);
|
2012-03-27 18:49:57 -04:00
|
|
|
|
2013-02-11 18:31:41 -05:00
|
|
|
finish(true, json);
|
2012-03-27 18:49:57 -04:00
|
|
|
}
|