diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-11-11 11:55:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-11-11 15:37:35 +0000 |
commit | c27374541e289962df6947967b97178bfa63e9f7 (patch) | |
tree | 2f4254eb30b9c5c3eef8ac9f770ddf26c6a5d992 /src/core/web_contents_delegate_qt.cpp | |
parent | e70b59112104b72e794c20f7c715482809780d32 (diff) | |
parent | 39f7ce19dbce34dfa7e730d6fa743d88109c3369 (diff) |
Merge "Merge remote-tracking branch 'origin/5.7' into 5.8" into refs/staging/5.8
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 9d0965818..36acfe62e 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -74,6 +74,7 @@ #include "ui/events/latency_info.h" #include <QDesktopServices> +#include <QTimer> namespace QtWebEngineCore { @@ -107,13 +108,19 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents Q_ASSERT(target); content::NavigationController::LoadURLParams load_url_params(params.url); + load_url_params.source_site_instance = params.source_site_instance; load_url_params.referrer = params.referrer; load_url_params.frame_tree_node_id = params.frame_tree_node_id; + load_url_params.redirect_chain = params.redirect_chain; load_url_params.transition_type = params.transition; load_url_params.extra_headers = params.extra_headers; load_url_params.should_replace_current_entry = params.should_replace_current_entry; load_url_params.is_renderer_initiated = params.is_renderer_initiated; load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; + if (params.uses_post) { + load_url_params.load_type = content::NavigationController::LOAD_TYPE_HTTP_POST; + load_url_params.post_data = params.post_data; + } target->GetController().LoadURLWithParams(load_url_params); return target; @@ -320,7 +327,11 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost *frameHost, m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode), web_contents(), toQt(params.default_file_name.value()), acceptedMimeTypes)); - m_viewClient->runFileChooser(m_filePickerController); + + // Defer the call to not block base::MessageLoop::RunTask with modal dialogs. + QTimer::singleShot(0, [this] () { + m_viewClient->runFileChooser(m_filePickerController); + }); } bool WebContentsDelegateQt::AddMessageToConsole(content::WebContents *source, int32_t level, const base::string16 &message, int32_t line_no, const base::string16 &source_id) |