| 29 | namespace webdriver { |
| 30 | |
| 31 | Alert::Alert(std::shared_ptr<DocumentHost> browser, HWND handle) { |
| 32 | LOG(TRACE) << "Entering Alert::Alert"; |
| 33 | this->browser_ = browser; |
| 34 | this->alert_handle_ = handle; |
| 35 | |
| 36 | this->is_standard_alert_ = true; |
| 37 | this->is_standard_control_alert_ = true; |
| 38 | HWND direct_ui_child = this->GetDirectUIChild(); |
| 39 | if (direct_ui_child) { |
| 40 | this->is_standard_control_alert_ = false; |
| 41 | DialogButtonInfo cancel_button_info = this->GetDialogButton(CANCEL); |
| 42 | if (cancel_button_info.button_exists) { |
| 43 | this->is_standard_alert_ = !IsLinkButton(cancel_button_info.button_handle); |
| 44 | } else { |
| 45 | DialogButtonInfo ok_button_info = this->GetDialogButton(OK); |
| 46 | if (ok_button_info.button_exists) { |
| 47 | this->is_standard_alert_ = !IsLinkButton(ok_button_info.button_handle); |
| 48 | } else { |
| 49 | this->is_standard_alert_ = false; |
| 50 | } |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | std::vector<char> window_class(30); |
| 55 | ::GetClassNameA(handle, &window_class[0], 30); |
| 56 | |
| 57 | if (strcmp(&window_class[0], SECURITY_DIALOG_WINDOW_CLASS) == 0) { |
| 58 | this->is_standard_alert_ = false; |
| 59 | this->is_standard_control_alert_ = false; |
| 60 | this->is_security_alert_ = true; |
| 61 | } else { |
| 62 | std::vector<HWND> text_boxes; |
| 63 | ::EnumChildWindows(this->alert_handle_, |
| 64 | &Alert::FindTextBoxes, |
| 65 | reinterpret_cast<LPARAM>(&text_boxes)); |
| 66 | this->is_security_alert_ = text_boxes.size() > 1; |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | |
| 71 | Alert::~Alert(void) { |
nothing calls this directly
no test coverage detected