| 477 | } |
| 478 | |
| 479 | LRESULT IECommandExecutor::OnSessionQuitWait(UINT uMsg, |
| 480 | WPARAM wParam, |
| 481 | LPARAM lParam, |
| 482 | BOOL& bHandled) { |
| 483 | LOG(TRACE) << "Entering IECommandExecutor::OnAllBrowserCloseWait"; |
| 484 | if (this->managed_browsers_.size() > 0) { |
| 485 | LOG(TRACE) << "Still have " << this->managed_browsers_.size() << " browsers"; |
| 486 | BrowserMap::const_iterator it = managed_browsers_.begin(); |
| 487 | for (; it != managed_browsers_.end(); ++it) { |
| 488 | LOG(TRACE) << "Still awaiting close of browser with ID " << it->first; |
| 489 | HWND alert_handle; |
| 490 | bool is_alert_active = this->IsAlertActive(it->second, |
| 491 | &alert_handle); |
| 492 | if (is_alert_active) { |
| 493 | // If there's an alert window active, the browser's Quit event does |
| 494 | // not fire until any alerts are handled. Note that OnBeforeUnload |
| 495 | // alerts must be handled here; the driver contains the ability to |
| 496 | // handle other standard alerts on the next received command. We rely |
| 497 | // on the browser's Quit command to remove the driver from the list of |
| 498 | // managed browsers. |
| 499 | Alert dialog(it->second, alert_handle); |
| 500 | if (!dialog.is_standard_alert()) { |
| 501 | dialog.Accept(); |
| 502 | is_alert_active = false; |
| 503 | } |
| 504 | } |
| 505 | } |
| 506 | ::Sleep(WAIT_TIME_IN_MILLISECONDS); |
| 507 | ::PostMessage(this->m_hWnd, |
| 508 | WD_SESSION_QUIT_WAIT, |
| 509 | NULL, |
| 510 | NULL); |
| 511 | } else { |
| 512 | for (auto& chromium_window_handle : this->chromium_window_handles_) { |
| 513 | ::PostMessage(chromium_window_handle, WM_CLOSE, NULL, NULL); |
| 514 | } |
| 515 | this->is_waiting_ = false; |
| 516 | Response quit_response; |
| 517 | quit_response.SetSuccessResponse(Json::Value::null); |
| 518 | this->serialized_response_ = quit_response.Serialize(); |
| 519 | } |
| 520 | return 0; |
| 521 | } |
| 522 | |
| 523 | LRESULT IECommandExecutor::OnAddChromiumWindowHandle(UINT uMsg, |
| 524 | WPARAM wParam, |
nothing calls this directly
no test coverage detected