| 452 | } |
| 453 | |
| 454 | int Browser::NavigateToUrl(const std::string& url, |
| 455 | std::string* error_message) { |
| 456 | LOG(TRACE) << "Entring Browser::NavigateToUrl"; |
| 457 | |
| 458 | std::wstring wide_url = StringUtilities::ToWString(url); |
| 459 | CComVariant url_variant(wide_url.c_str()); |
| 460 | CComVariant dummy; |
| 461 | |
| 462 | HRESULT hr = this->browser_->Navigate2(&url_variant, |
| 463 | &dummy, |
| 464 | &dummy, |
| 465 | &dummy, |
| 466 | &dummy); |
| 467 | if (FAILED(hr)) { |
| 468 | LOGHR(WARN, hr) << "Call to IWebBrowser2::Navigate2 failed"; |
| 469 | _com_error error(hr); |
| 470 | std::wstring formatted_message = StringUtilities::Format( |
| 471 | L"Received error: 0x%08x ['%s']", |
| 472 | hr, |
| 473 | error.ErrorMessage()); |
| 474 | *error_message = StringUtilities::ToString(formatted_message); |
| 475 | return EUNHANDLEDERROR; |
| 476 | } |
| 477 | |
| 478 | this->set_wait_required(true); |
| 479 | return WD_SUCCESS; |
| 480 | } |
| 481 | |
| 482 | int Browser::NavigateBack() { |
| 483 | LOG(TRACE) << "Entering Browser::NavigateBack"; |
no test coverage detected