1
1
// vim:expandtab:shiftwidth=2:tabstop=2:
2
// Copyright (C) 2014-2015 Canonical Ltd.
2
// Copyright (C) 2014-2016 Canonical Ltd.
4
4
// This library is free software; you can redistribute it and/or
5
5
// modify it under the terms of the GNU Lesser General Public
18
18
#ifndef _OXIDE_QT_CORE_API_CERTIFICATE_ERROR_P_H_
19
19
#define _OXIDE_QT_CORE_API_CERTIFICATE_ERROR_P_H_
21
23
#include <QtGlobal>
23
#include "base/memory/scoped_ptr.h"
25
25
#include "qt/core/api/oxideqcertificateerror.h"
26
#include "qt/core/api/oxideqglobal.h"
26
27
#include "qt/core/api/oxideqsslcertificate.h"
29
30
class CertificateError;
32
class OxideQSslCertificate;
34
class OxideQCertificateErrorPrivate final {
33
class OXIDE_QTCORE_EXPORT OxideQCertificateErrorPrivate final {
35
34
Q_DECLARE_PUBLIC(OxideQCertificateError)
38
37
~OxideQCertificateErrorPrivate();
40
static OxideQCertificateError* Create(
41
scoped_ptr<oxide::CertificateError> error,
39
static OxideQCertificateErrorPrivate* get(OxideQCertificateError* q);
41
static std::unique_ptr<OxideQCertificateError> Create(
42
std::unique_ptr<oxide::CertificateError> error,
42
43
QObject* parent = nullptr);
45
typedef void (*ResponseCallback)(bool);
47
static std::unique_ptr<OxideQCertificateError> CreateForTesting(
50
OxideQCertificateError::Error error,
51
const OxideQSslCertificate& cert,
53
bool strict_enforcement,
55
const std::function<void(bool)>& callback);
57
void SimulateCancel();
45
60
OxideQCertificateErrorPrivate(
46
scoped_ptr<oxide::CertificateError> error);
61
std::unique_ptr<oxide::CertificateError> error);
49
64
void respond(bool accept);