MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / Close

Method Close

cpp/iedriver/Browser.cpp:427–452  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void Browser::Close() {
428 LOG(TRACE) << "Entering Browser::Close";
429 if (this->is_edge_chromium()) {
430 // For Edge in IE Mode, cache the top-level hosting Chromium window
431 // handle so they can be properly closed on quit.
432 HWND top_level_window_handle = this->GetTopLevelWindowHandle();
433 ::SendMessage(this->executor_handle(),
434 WD_ADD_CHROMIUM_WINDOW_HANDLE,
435 reinterpret_cast<WPARAM>(top_level_window_handle),
436 NULL);
437 }
438
439 this->is_explicit_close_requested_ = true;
440 this->set_is_closing(true);
441 // Closing the browser, so having focus on a frame doesn't
442 // make any sense.
443 this->SetFocusedFrameByElement(NULL);
444
445 HRESULT hr = S_OK;
446 hr = this->browser_->Stop();
447 hr = this->browser_->Quit();
448
449 if (FAILED(hr)) {
450 LOGHR(WARN, hr) << "Call to IWebBrowser2::Quit failed";
451 }
452}
453
454int Browser::NavigateToUrl(const std::string& url,
455 std::string* error_message) {

Callers 2

ExecuteInternalMethod · 0.45
ExecuteInternalMethod · 0.45

Calls 8

is_edge_chromiumMethod · 0.80
executor_handleMethod · 0.80
set_is_closingMethod · 0.80
LOGClass · 0.50
StopMethod · 0.45
QuitMethod · 0.45

Tested by

no test coverage detected