Path: blob/trunk/cpp/iedriver/CommandHandlers/GetAllWindowHandlesCommandHandler.cpp
2868 views
// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the "License");5// you may not use this file except in compliance with the License.6// You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// distributed under the License is distributed on an "AS IS" BASIS,12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13// See the License for the specific language governing permissions and14// limitations under the License.1516#include "GetAllWindowHandlesCommandHandler.h"17#include "../Browser.h"18#include "../IECommandExecutor.h"1920namespace webdriver {2122GetAllWindowHandlesCommandHandler::GetAllWindowHandlesCommandHandler(void) {23}2425GetAllWindowHandlesCommandHandler::~GetAllWindowHandlesCommandHandler(void) {26}2728void GetAllWindowHandlesCommandHandler::ExecuteInternal(29const IECommandExecutor& executor,30const ParametersMap& command_parameters,31Response* response) {32Json::Value handles(Json::arrayValue);33std::vector<std::string> handle_list;34executor.GetManagedBrowserHandles(&handle_list);35for (unsigned int i = 0; i < handle_list.size(); ++i) {36handles.append(handle_list[i]);37}3839response->SetSuccessResponse(handles);40}4142} // namespace webdriver434445