summaryrefslogtreecommitdiffstats
path: root/src/core/api
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-12 17:38:32 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2015-10-16 14:22:34 +0000
commitd9d1cc3ec8931cecc0b0dcb5d5d184cdb53ff434 (patch)
tree5733a96d78502f4f2f3b3326403e717636b04f34 /src/core/api
parentfbfd6b7617a88bf9668f88be5db220d3a3f92071 (diff)
Decouple scheme and url scheme handler
Remove the scheme from the url scheme handler constructor, this way the same handler can handle multiple schemes, the API look more natural and we can get rid of the private class. Change-Id: I33906b8a5ea51641e28a53f93f4feb1472c24baf Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/core/api')
-rw-r--r--src/core/api/core_api.pro3
-rw-r--r--src/core/api/qwebengineurlschemehandler.cpp19
-rw-r--r--src/core/api/qwebengineurlschemehandler.h5
-rw-r--r--src/core/api/qwebengineurlschemehandler_p.h67
4 files changed, 4 insertions, 90 deletions
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
index 6a37b2ac3..e4cdf43cb 100644
--- a/src/core/api/core_api.pro
+++ b/src/core/api/core_api.pro
@@ -39,8 +39,7 @@ HEADERS = \
qwebengineurlrequestinfo.h \
qwebengineurlrequestinfo_p.h \
qwebengineurlrequestjob.h \
- qwebengineurlschemehandler.h \
- qwebengineurlschemehandler_p.h
+ qwebengineurlschemehandler.h
SOURCES = \
qwebenginecookiestoreclient.cpp \
diff --git a/src/core/api/qwebengineurlschemehandler.cpp b/src/core/api/qwebengineurlschemehandler.cpp
index e6c20dbca..f887e4e98 100644
--- a/src/core/api/qwebengineurlschemehandler.cpp
+++ b/src/core/api/qwebengineurlschemehandler.cpp
@@ -35,7 +35,6 @@
****************************************************************************/
#include "qwebengineurlschemehandler.h"
-#include "qwebengineurlschemehandler_p.h"
#include "qwebengineurlrequestjob.h"
@@ -59,20 +58,14 @@ QT_BEGIN_NAMESPACE
This signal is emitted when the custom URL scheme handler \a handler is deleted.
*/
-QWebEngineUrlSchemeHandlerPrivate::QWebEngineUrlSchemeHandlerPrivate(const QByteArray &scheme)
- : m_scheme(scheme)
-{
-}
-
/*!
Constructs a new URL scheme handler.
- The handler is created for \a scheme with the parent \a parent.
+ The handler is created with the parent \a parent.
*/
-QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(const QByteArray &scheme, QObject *parent)
+QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(QObject *parent)
: QObject(parent)
- , d_ptr(new QWebEngineUrlSchemeHandlerPrivate(scheme))
{
}
@@ -86,14 +79,6 @@ QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler()
}
/*!
- Returns the custom URL scheme handled.
-*/
-QByteArray QWebEngineUrlSchemeHandler::scheme() const
-{
- return d_ptr->scheme();
-}
-
-/*!
\fn void QWebEngineUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob *request)
This method is called whenever a request \a request for the registered scheme is started.
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index 1b6a66706..8c1e52646 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -39,7 +39,6 @@
#include "qtwebenginecoreglobal.h"
-#include <QtCore/qbytearray.h>
#include <QtCore/qobject.h>
namespace QtWebEngineCore {
@@ -54,11 +53,9 @@ class QWebEngineUrlSchemeHandlerPrivate;
class QWEBENGINE_EXPORT QWebEngineUrlSchemeHandler : public QObject {
Q_OBJECT
public:
- QWebEngineUrlSchemeHandler(const QByteArray &scheme, QObject *parent = 0);
+ QWebEngineUrlSchemeHandler(QObject *parent = 0);
~QWebEngineUrlSchemeHandler();
- QByteArray scheme() const;
-
virtual void requestStarted(QWebEngineUrlRequestJob*) = 0;
Q_SIGNALS:
diff --git a/src/core/api/qwebengineurlschemehandler_p.h b/src/core/api/qwebengineurlschemehandler_p.h
deleted file mode 100644
index d63666326..000000000
--- a/src/core/api/qwebengineurlschemehandler_p.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QWEBENGINEURLSCHEMEHANDLER_P_H
-#define QWEBENGINEURLSCHEMEHANDLER_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <QtCore/qbytearray.h>
-
-QT_BEGIN_NAMESPACE
-
-class QWEBENGINE_EXPORT QWebEngineUrlSchemeHandlerPrivate {
-public:
- QWebEngineUrlSchemeHandlerPrivate(const QByteArray &);
-
- const QByteArray &scheme() const { return m_scheme; }
-
-private:
- QByteArray m_scheme;
-};
-
-QT_END_NAMESPACE
-
-#endif // QWEBENGINEURLSCHEMEHANDLER_P_H