"Fossies" - the Fresh Open Source Software Archive

Member "selenium-selenium-4.8.1/cpp/iedriver/CommandHandlers/GetTitleCommandHandler.cpp" (17 Feb 2023, 1561 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "GetTitleCommandHandler.cpp" see the Fossies "Dox" file reference documentation.

    1 // Licensed to the Software Freedom Conservancy (SFC) under one
    2 // or more contributor license agreements. See the NOTICE file
    3 // distributed with this work for additional information
    4 // regarding copyright ownership. The SFC licenses this file
    5 // to you under the Apache License, Version 2.0 (the "License");
    6 // you may not use this file except in compliance with the License.
    7 // You may obtain a copy of the License at
    8 //
    9 //     http://www.apache.org/licenses/LICENSE-2.0
   10 //
   11 // Unless required by applicable law or agreed to in writing, software
   12 // distributed under the License is distributed on an "AS IS" BASIS,
   13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   14 // See the License for the specific language governing permissions and
   15 // limitations under the License.
   16 
   17 #include "GetTitleCommandHandler.h"
   18 #include "errorcodes.h"
   19 #include "../Browser.h"
   20 #include "../IECommandExecutor.h"
   21 
   22 namespace webdriver {
   23 
   24 GetTitleCommandHandler::GetTitleCommandHandler(void) {
   25 }
   26 
   27 GetTitleCommandHandler::~GetTitleCommandHandler(void) {
   28 }
   29 
   30 void GetTitleCommandHandler::ExecuteInternal(
   31     const IECommandExecutor& executor,
   32     const ParametersMap& command_parameters,
   33     Response* response) {
   34   BrowserHandle browser_wrapper;
   35   int status_code = executor.GetCurrentBrowser(&browser_wrapper);
   36   if (status_code != WD_SUCCESS) {
   37     response->SetErrorResponse(ERROR_NO_SUCH_WINDOW, "Unable to get browser");
   38     return;
   39   }
   40   std::string title = browser_wrapper->GetTitle();
   41   response->SetSuccessResponse(title);
   42 }
   43 
   44 } // namespace webdriver