HRESULT STDMETHODCALLTYPE WebKitUIDelegate::runJavaScriptTextInputPanelWithPrompt(
    /* [in] */ IWebView *sender,
    /* [in] */ BSTR message,
    /* [in] */ BSTR defaultText,
    /* [retval][out] */ BSTR *result)
{
    HWND handle = window->GetWindowHandle();
    std::string title(window->GetTitle());
    std::string msg = _bstr_t(message);
    std::string def;

    if (defaultText)
    {
        def.append(_bstr_t(defaultText));
    }

    PopupDialog popupDialog(handle);
    popupDialog.SetTitle(title);
    popupDialog.SetMessage(msg);
    popupDialog.SetShowInputText(true);
    popupDialog.SetInputText(def);
    popupDialog.SetShowCancelButton(true);
    int r = popupDialog.Show();

    if (r == IDOK)
    {
        _bstr_t bstr1(popupDialog.GetInputText().c_str());
        *result = bstr1.copy();
    }

    return S_OK;
}
void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {

	if (isEnabled()) {
		PopUpDialog popupDialog(this, x + getAbsX(), y + getAbsY());
		int newSel = popupDialog.runModal();
		if (newSel != -1 && _selectedItem != newSel) {
			_selectedItem = newSel;
			sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
		}
		g_gui.clearDragWidget();
	}
}
Beispiel #3
0
	int SendCrashReport()
	{
		InitCrashDetection();
		std::string title = GetCrashDetectionTitle();
		std::string msg = GetCrashDetectionHeader();
		msg.append("\n\n");
		msg.append(GetCrashDetectionMessage());

		Win32PopupDialog popupDialog(NULL);
		popupDialog.SetTitle(title);
		popupDialog.SetMessage(msg);
		popupDialog.SetShowCancelButton(true);
		if (popupDialog.Show() != IDYES)
		{
			return __LINE__;
		}

		wstring url = L"https://";
		url += StringToWString(CRASH_REPORT_URL);

		const std::map<wstring, wstring> parameters = GetCrashReportParametersW();
		wstring dumpFilePathW = StringToWString(dumpFilePath);
		wstring responseBody;
		int responseCode;
		
		bool success = google_breakpad::HTTPUpload::SendRequest(
			url,
			parameters,
			dumpFilePathW.c_str(),
			L"dump",
			NULL,
			&responseBody,
			&responseCode);
	
		if (!success)
		{
#ifdef DEBUG		
			ShowError("Error uploading crash dump.");
#endif
			return __LINE__;
		}
#ifdef DEBUG
		else
		{
			MessageBoxW(NULL,L"Your crash report has been submitted. Thank You!",L"Error Reporting Status",MB_OK | MB_ICONINFORMATION);
		}
#endif
		return 0;
	}