summaryrefslogtreecommitdiffstats
path: root/src/core/login_delegate_qt.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-10-17 17:51:50 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-01-28 19:03:32 +0000
commite63b35763907304089d961bc3e284178d36c69a3 (patch)
treee3fe946240ddfe6b29ce5b72dd16a1db6855f4f1 /src/core/login_delegate_qt.cpp
parent5e66cbc85a350616070a318f917cb181313c4afa (diff)
Adaptations for Chromium 70
Change-Id: I8bb77784dbc8a0b9debd96a4c49421bd34e6a0df Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/login_delegate_qt.cpp')
-rw-r--r--src/core/login_delegate_qt.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 9659b354a..31824ca71 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -43,7 +43,9 @@
#include "login_delegate_qt.h"
+#include "base/task/post_task.h"
#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
@@ -66,14 +68,9 @@ LoginDelegateQt::LoginDelegateQt(
: m_authInfo(authInfo)
, m_url(url)
, m_auth_required_callback(std::move(auth_required_callback))
+ , m_webContentsGetter(web_contents_getter)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
-
- content::BrowserThread::PostTask(
- content::BrowserThread::UI, FROM_HERE,
- base::Bind(&LoginDelegateQt::triggerDialog,
- this,
- web_contents_getter));
}
LoginDelegateQt::~LoginDelegateQt()
@@ -81,6 +78,13 @@ LoginDelegateQt::~LoginDelegateQt()
Q_ASSERT(m_dialogController.isNull());
}
+void LoginDelegateQt::triggerDialog()
+{
+ base::PostTaskWithTraits(
+ FROM_HERE, { content::BrowserThread::UI },
+ base::BindOnce(&LoginDelegateQt::triggerDialogOnUI, this));
+}
+
void LoginDelegateQt::OnRequestCancelled()
{
destroy();
@@ -107,11 +111,11 @@ bool LoginDelegateQt::isProxy() const
return m_authInfo->is_proxy;
}
-void LoginDelegateQt::triggerDialog(const content::ResourceRequestInfo::WebContentsGetter &webContentsGetter)
+void LoginDelegateQt::triggerDialogOnUI()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
content::WebContentsImpl *webContents =
- static_cast<content::WebContentsImpl *>(webContentsGetter.Run());
+ static_cast<content::WebContentsImpl *>(m_webContentsGetter.Run());
if (!webContents)
return;
WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client();