| 425 | } |
| 426 | |
| 427 | void 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 | |
| 454 | int Browser::NavigateToUrl(const std::string& url, |
| 455 | std::string* error_message) { |
no test coverage detected