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-03-27 18:49:57 -04:00
|
|
|
#include <QStringList>
|
|
|
|
|
2012-04-04 18:18:17 -04:00
|
|
|
GetWindowHandles::GetWindowHandles(WebPageManager *manager, QStringList &arguments, QObject *parent) : Command(manager, arguments, parent) {
|
2012-03-27 18:49:57 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void GetWindowHandles::start() {
|
2012-04-04 18:18:17 -04:00
|
|
|
QListIterator<WebPage *> pageIterator = manager()->iterator();
|
2012-03-27 18:49:57 -04:00
|
|
|
|
|
|
|
QString handles = "[";
|
|
|
|
QStringList stringList;
|
|
|
|
|
|
|
|
while (pageIterator.hasNext()) {
|
|
|
|
stringList.append("\"" + pageIterator.next()->uuid() + "\"");
|
|
|
|
}
|
|
|
|
|
|
|
|
handles += stringList.join(",") + "]";
|
|
|
|
|
|
|
|
emit finished(new Response(true, handles));
|
|
|
|
}
|