aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2008-03-15 05:58:08 +0800
committerChristian Persch <chpe@src.gnome.org>2008-03-15 05:58:08 +0800
commitd548860413ac5cea45610bd4c846c846c1619ec7 (patch)
tree7c386b6a04912d356a8beb8e59bee597dc779974 /embed
parentf9a8a26f862069c0ca841e1ee5b798e9a625d65e (diff)
downloadgsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar.gz
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar.bz2
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar.lz
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar.xz
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.tar.zst
gsoc2013-epiphany-d548860413ac5cea45610bd4c846c846c1619ec7.zip
Add a service to open the cert exception dialogue.
svn path=/trunk/; revision=8110
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/ephyAddCertException.h99
-rw-r--r--embed/mozilla/ephyAddCertException.idl8
-rw-r--r--embed/mozilla/ephyAddCertException.js105
-rw-r--r--embed/mozilla/ephyAddCertException.xptbin0 -> 211 bytes
4 files changed, 212 insertions, 0 deletions
diff --git a/embed/mozilla/ephyAddCertException.h b/embed/mozilla/ephyAddCertException.h
new file mode 100644
index 000000000..04f84cebf
--- /dev/null
+++ b/embed/mozilla/ephyAddCertException.h
@@ -0,0 +1,99 @@
+/*
+ * DO NOT EDIT. THIS FILE IS GENERATED FROM ephyAddCertException.idl
+ */
+
+#ifndef __gen_ephyAddCertException_h__
+#define __gen_ephyAddCertException_h__
+
+
+#ifndef __gen_nsISupports_h__
+#include "nsISupports.h"
+#endif
+
+#ifndef __gen_nsIDOMWindow_h__
+#include "nsIDOMWindow.h"
+#endif
+
+#ifndef __gen_nsIDOMDocument_h__
+#include "nsIDOMDocument.h"
+#endif
+
+/* For IDL files that don't want to include root IDL files. */
+#ifndef NS_NO_VTABLE
+#define NS_NO_VTABLE
+#endif
+
+/* starting interface: ephyAddCertException */
+#define EPHYADDCERTEXCEPTION_IID_STR "cfdca027-c2c7-446a-8031-4d0041ab9f1e"
+
+#define EPHYADDCERTEXCEPTION_IID \
+ {0xcfdca027, 0xc2c7, 0x446a, \
+ { 0x80, 0x31, 0x4d, 0x00, 0x41, 0xab, 0x9f, 0x1e }}
+
+class NS_NO_VTABLE ephyAddCertException : public nsISupports {
+ public:
+
+ NS_DECLARE_STATIC_IID_ACCESSOR(EPHYADDCERTEXCEPTION_IID)
+
+ /* void showAddCertExceptionDialog (in nsIDOMDocument aDocument); */
+ NS_IMETHOD ShowAddCertExceptionDialog(nsIDOMDocument *aDocument) = 0;
+
+};
+
+ NS_DEFINE_STATIC_IID_ACCESSOR(ephyAddCertException, EPHYADDCERTEXCEPTION_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_EPHYADDCERTEXCEPTION \
+ NS_IMETHOD ShowAddCertExceptionDialog(nsIDOMDocument *aDocument);
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_EPHYADDCERTEXCEPTION(_to) \
+ NS_IMETHOD ShowAddCertExceptionDialog(nsIDOMDocument *aDocument) { return _to ShowAddCertExceptionDialog(aDocument); }
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_EPHYADDCERTEXCEPTION(_to) \
+ NS_IMETHOD ShowAddCertExceptionDialog(nsIDOMDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->ShowAddCertExceptionDialog(aDocument); }
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public ephyAddCertException
+{
+public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_EPHYADDCERTEXCEPTION
+
+ _MYCLASS_();
+
+private:
+ ~_MYCLASS_();
+
+protected:
+ /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, ephyAddCertException)
+
+_MYCLASS_::_MYCLASS_()
+{
+ /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+ /* destructor code */
+}
+
+/* void showAddCertExceptionDialog (in nsIDOMDocument aDocument); */
+NS_IMETHODIMP _MYCLASS_::ShowAddCertExceptionDialog(nsIDOMDocument *aDocument)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+#endif /* __gen_ephyAddCertException_h__ */
diff --git a/embed/mozilla/ephyAddCertException.idl b/embed/mozilla/ephyAddCertException.idl
new file mode 100644
index 000000000..3d04140b6
--- /dev/null
+++ b/embed/mozilla/ephyAddCertException.idl
@@ -0,0 +1,8 @@
+#include "nsISupports.idl"
+#include "nsIDOMWindow.idl"
+#include "nsIDOMDocument.idl"
+
+[uuid(cfdca027-c2c7-446a-8031-4d0041ab9f1e)]
+interface ephyAddCertException : nsISupports {
+ void showAddCertExceptionDialog (in nsIDOMDocument aDocument);
+};
diff --git a/embed/mozilla/ephyAddCertException.js b/embed/mozilla/ephyAddCertException.js
new file mode 100644
index 000000000..874c1a50a
--- /dev/null
+++ b/embed/mozilla/ephyAddCertException.js
@@ -0,0 +1,105 @@
+/*
+ 1 # -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ 2 # ***** BEGIN LICENSE BLOCK *****
+ 3 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ 4 #
+ 5 # The contents of this file are subject to the Mozilla Public License Version
+ 6 # 1.1 (the "License"); you may not use this file except in compliance with
+ 7 # the License. You may obtain a copy of the License at
+ 8 # http://www.mozilla.org/MPL/
+ 9 #
+ 10 # Software distributed under the License is distributed on an "AS IS" basis,
+ 11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ 12 # for the specific language governing rights and limitations under the
+ 13 # License.
+ 14 #
+ 15 # The Original Code is mozilla.org code.
+ 16 #
+ 17 # The Initial Developer of the Original Code is
+ 18 # Netscape Communications Corporation.
+ 19 # Portions created by the Initial Developer are Copyright (C) 1998
+ 20 # the Initial Developer. All Rights Reserved.
+ 21 #
+ 22 # Contributor(s):
+ 23 # Blake Ross <blake@cs.stanford.edu>
+ 24 # David Hyatt <hyatt@mozilla.org>
+ 25 # Peter Annema <disttsc@bart.nl>
+ 26 # Dean Tessman <dean_tessman@hotmail.com>
+ 27 # Kevin Puetz <puetzk@iastate.edu>
+ 28 # Ben Goodger <ben@netscape.com>
+ 29 # Pierre Chanial <chanial@noos.fr>
+ 30 # Jason Eager <jce2@po.cwru.edu>
+ 31 # Joe Hewitt <hewitt@netscape.com>
+ 32 # Alec Flett <alecf@netscape.com>
+ 33 # Asaf Romano <mozilla.mano@sent.com>
+ 34 # Jason Barnabe <jason_barnabe@fastmail.fm>
+ 35 # Peter Parente <parente@cs.unc.edu>
+ 36 # Giorgio Maone <g.maone@informaction.com>
+ 37 # Tom Germeau <tom.germeau@epigoon.com>
+ 38 # Jesse Ruderman <jruderman@gmail.com>
+ 39 # Joe Hughes <joe@retrovirus.com>
+ 40 # Pamela Greene <pamg.bugs@gmail.com>
+ 41 # Michael Ventnor <m.ventnor@gmail.com>
+ 42 # Simon Bünzli <zeniko@gmail.com>
+ 43 # Johnathan Nightingale <johnath@mozilla.com>
+ 44 # Ehsan Akhgari <ehsan.akhgari@gmail.com>
+ 45 # Dão Gottwald <dao@mozilla.com>
+ 46 #
+ 47 # Alternatively, the contents of this file may be used under the terms of
+ 48 # either the GNU General Public License Version 2 or later (the "GPL"), or
+ 49 # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ 50 # in which case the provisions of the GPL or the LGPL are applicable instead
+ 51 # of those above. If you wish to allow use of your version of this file only
+ 52 # under the terms of either the GPL or the LGPL, and not to allow others to
+ 53 # use your version of this file under the terms of the MPL, indicate your
+ 54 # decision by deleting the provisions above and replace them with the notice
+ 55 # and other provisions required by the GPL or the LGPL. If you do not delete
+ 56 # the provisions above, a recipient may use your version of this file under
+ 57 # the terms of any one of the MPL, the GPL or the LGPL.
+*/
+
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
+
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+
+function ephyAddCertExceptionService() { }
+
+ephyAddCertExceptionService.prototype = {
+
+ classDescription: "ephyAddCertException dialogue",
+ contractID: "@gnome.org/epiphany/add-cert-exception;1",
+ classID: Components.ID("{f32ede25-4135-4896-834a-303326c553d4}"),
+ QueryInterface: XPCOMUtils.generateQI([Ci.ephyAddCertException]),
+
+ showAddCertExceptionDialog : function(aDocument) {
+ var params = { exceptionAdded : false };
+
+ try {
+ /*
+ switch (gPrefService.getIntPref("browser.ssl_override_behavior")) {
+ case 2 : // Pre-fetch & pre-populate
+ params.prefetchCert = true;
+ case 1 : // Pre-populate
+ params.location = aLocation.href;
+ }*/
+ params.location = aDocument.location.href;
+ params.prefetchCert = true;
+ } catch (e) {
+ Cu.reportError("Couldn't get ssl_override pref: " + e);
+ }
+
+ window.openDialog('chrome://pippki/content/exceptionDialog.xul',
+ '','chrome,centerscreen,modal', params);
+
+ // If the user added the exception cert, attempt to reload the page
+ if (params.exceptionAdded)
+ aDocument.location.reload();
+ }
+};
+
+var component = [ephyAddCertExceptionService];
+function NSGetModule(compMgr, fileSpec) {
+ return XPCOMUtils.generateModule(component);
+}
diff --git a/embed/mozilla/ephyAddCertException.xpt b/embed/mozilla/ephyAddCertException.xpt
new file mode 100644
index 000000000..d66b58832
--- /dev/null
+++ b/embed/mozilla/ephyAddCertException.xpt
Binary files differ