1 /* ownCloud Android client application
2 * Copyright (C) 2012-2014 ownCloud Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package com
.owncloud
.android
.ui
.dialog
;
19 import android
.net
.http
.SslError
;
20 import android
.webkit
.SslErrorHandler
;
22 import com
.actionbarsherlock
.app
.SherlockDialogFragment
;
25 * Dialog to show information about an untrusted certificate and allow the user
26 * to decide trust on it or not.
28 * Abstract implementation of common functionality for different dialogs that
29 * get the information about the error and the certificate from different classes.
32 * @author David A. Velasco
34 public abstract class SslUntrustedCertDialogABSTRACT
extends SherlockDialogFragment
{
36 //private final static String TAG = SslUntrustedCertDialogABSTRACT.class.getSimpleName();
38 public static SslUntrustedCertDialogABSTRACT
newInstanceForEmptySslError(SslError error
, SslErrorHandler handler
) {
40 throw new IllegalArgumentException("Trying to create instance with a parameter error == null");
42 return SslUntrustedCertDialogForEmptySslError
.newInstance(error
, handler
);
45 // TODO - complete when merged
47 public static SslUntrustedCertDialogABSTRACT newInstanceForFullSslError(X509Certificate cert, SslError error, OnSslUntrustedCertListener listener, SslErrorHandler handler) {
49 throw new IllegalArgumentException("Trying to create instance with a parameter error == null");
52 throw new IllegalArgumentException("Trying to create instance with a parameter error == null");
54 return new SslUntrustedCertDialog(cert, listener, handler);
59 public interface OnSslUntrustedCertListener
{
60 public void onSavedCertificate();
61 public void onFailedSavingCertificate();