summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_blocking_page.h
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 03:29:03 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-16 03:29:03 +0000
commit3b073b258b19937b1dd9b6b2a609dee207865eba (patch)
treefb0779236d58e8a49513c1036d891c2e10c9573c /chrome/browser/ssl/ssl_blocking_page.h
parent7fb087e0800d0faaa31e4a029ad6813f251b4848 (diff)
downloadchromium_src-3b073b258b19937b1dd9b6b2a609dee207865eba.zip
chromium_src-3b073b258b19937b1dd9b6b2a609dee207865eba.tar.gz
chromium_src-3b073b258b19937b1dd9b6b2a609dee207865eba.tar.bz2
Move all the SSL stuff into its own subdir
Review URL: http://codereview.chromium.org/18137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ssl/ssl_blocking_page.h')
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h
new file mode 100644
index 0000000..c3c2289
--- /dev/null
+++ b/chrome/browser/ssl/ssl_blocking_page.h
@@ -0,0 +1,71 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SSL_BLOCKING_PAGE_H_
+#define CHROME_BROWSER_SSL_BLOCKING_PAGE_H_
+
+#include <string>
+
+#include "chrome/browser/tab_contents/interstitial_page.h"
+#include "chrome/browser/ssl/ssl_manager.h"
+#include "chrome/views/decision.h"
+
+// This class is responsible for showing/hiding the interstitial page that is
+// shown when a certificate error happens.
+// It deletes itself when the interstitial page is closed.
+class SSLBlockingPage : public InterstitialPage {
+ public:
+ // An interface that classes that want to interact with the SSLBlockingPage
+ // should implement.
+ class Delegate {
+ public:
+ // Should return the information about the error that causes this blocking
+ // page.
+ virtual SSLErrorInfo GetSSLErrorInfo(SSLManager::CertError* error) = 0;
+
+ // Notification that the user chose to reject the certificate.
+ virtual void OnDenyCertificate(SSLManager::CertError* error) = 0;
+
+ // Notification that the user chose to accept the certificate.
+ virtual void OnAllowCertificate(SSLManager::CertError* error) = 0;
+ };
+
+ SSLBlockingPage(SSLManager::CertError* error, Delegate* delegate);
+ virtual ~SSLBlockingPage();
+
+ // A method that sets strings in the specified dictionary from the passed
+ // vector so that they can be used to resource the ssl_roadblock.html/
+ // ssl_error.html files.
+ // Note: there can be up to 5 strings in |extra_info|.
+ static void SetExtraInfo(DictionaryValue* strings,
+ const std::vector<std::wstring>& extra_info);
+
+ protected:
+ // InterstitialPage implementation.
+ virtual std::string GetHTMLContents();
+ virtual void CommandReceived(const std::string& command);
+ virtual void UpdateEntry(NavigationEntry* entry);
+ virtual void Proceed();
+ virtual void DontProceed();
+
+ private:
+ void NotifyDenyCertificate();
+ void NotifyAllowCertificate();
+
+ // The error we represent. We will either call CancelRequest() or
+ // ContinueRequest() on this object.
+ scoped_refptr<SSLManager::CertError> error_;
+
+ // Our delegate. It provides useful information, like the title and details
+ // about this error.
+ Delegate* delegate_;
+
+ // A flag to indicate if we've notified |delegate_| of the user's decision.
+ bool delegate_has_been_notified_;
+
+
+ DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage);
+};
+
+#endif // #ifndef CHROME_BROWSER_SSL_BLOCKING_PAGE_H_