| 1207 | } |
| 1208 | |
| 1209 | bool IECommandExecutor::IsAlertActive(BrowserHandle browser, HWND* alert_handle) { |
| 1210 | LOG(TRACE) << "Entering IECommandExecutor::IsAlertActive"; |
| 1211 | HWND dialog_handle = browser->GetActiveDialogWindowHandle(); |
| 1212 | if (dialog_handle != NULL) { |
| 1213 | // Found a window handle, make sure it's an actual alert, |
| 1214 | // and not a showModalDialog() window. |
| 1215 | std::vector<char> window_class_name(34); |
| 1216 | ::GetClassNameA(dialog_handle, &window_class_name[0], 34); |
| 1217 | if (strcmp(ALERT_WINDOW_CLASS, &window_class_name[0]) == 0) { |
| 1218 | *alert_handle = dialog_handle; |
| 1219 | return true; |
| 1220 | } else if (strcmp(SECURITY_DIALOG_WINDOW_CLASS, &window_class_name[0]) == 0) { |
| 1221 | *alert_handle = dialog_handle; |
| 1222 | return true; |
| 1223 | } else { |
| 1224 | LOG(WARN) << "Found alert handle does not have a window class consistent with an alert"; |
| 1225 | } |
| 1226 | } else { |
| 1227 | LOG(DEBUG) << "No alert handle is found"; |
| 1228 | } |
| 1229 | return false; |
| 1230 | } |
| 1231 | |
| 1232 | bool IECommandExecutor::HandleUnexpectedAlert(BrowserHandle browser, |
| 1233 | HWND alert_handle, |
no test coverage detected