Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(404)

Unified Diff: ios/chrome/browser/ssl/ios_ssl_blocking_page.h

Issue 1566753002: Upstream iOS SSL blocking page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@non-virtual-string-provider
Patch Set: Add OWNERS file Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/ssl/OWNERS ('k') | ios/chrome/browser/ssl/ios_ssl_blocking_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ssl/ios_ssl_blocking_page.h
diff --git a/ios/chrome/browser/ssl/ios_ssl_blocking_page.h b/ios/chrome/browser/ssl/ios_ssl_blocking_page.h
new file mode 100644
index 0000000000000000000000000000000000000000..be5b946371db93360a9f8cfdced8998b4126d848
--- /dev/null
+++ b/ios/chrome/browser/ssl/ios_ssl_blocking_page.h
@@ -0,0 +1,80 @@
+// Copyright 2016 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 IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
+#define IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
+
+#include <string>
+#include <vector>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "components/certificate_reporting/error_report.h"
+#include "ios/chrome/browser/interstitials/ios_security_interstitial_page.h"
+#include "net/ssl/ssl_info.h"
+
+class IOSChromeControllerClient;
+class GURL;
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+namespace security_interstitials {
+class SSLErrorUI;
+}
+
+// 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 IOSSSLBlockingPage : public IOSSecurityInterstitialPage {
+ public:
+ ~IOSSSLBlockingPage() override;
+
+ // Creates an SSL blocking page. If the blocking page isn't shown, the caller
+ // is responsible for cleaning up the blocking page, otherwise the
+ // interstitial takes ownership when shown. |options_mask| must be a bitwise
+ // mask of SSLErrorUI::SSLErrorOptionsMask values.
+ IOSSSLBlockingPage(web::WebState* web_state,
+ int cert_error,
+ const net::SSLInfo& ssl_info,
+ const GURL& request_url,
+ int options_mask,
+ const base::Time& time_triggered,
+ const base::Callback<void(bool)>& callback);
+
+ protected:
+ // InterstitialPageDelegate implementation.
+ void CommandReceived(const std::string& command) override;
+ void OnProceed() override;
+ void OnDontProceed() override;
+
+ // SecurityInterstitialPage implementation:
+ bool ShouldCreateNewNavigation() const override;
+ void PopulateInterstitialStrings(
+ base::DictionaryValue* load_time_data) const override;
+ void AfterShow() override;
+
+ private:
+ void NotifyDenyCertificate();
+
+ // Returns true if |options_mask| refers to a soft-overridable SSL error.
+ static bool IsOverridable(int options_mask);
+
+ base::Callback<void(bool)> callback_;
+ const net::SSLInfo ssl_info_;
+ const bool overridable_; // The UI allows the user to override the error.
+
+ // The user previously allowed a bad certificate, but the decision has now
+ // expired.
+ const bool expired_but_previously_allowed_;
+
+ scoped_ptr<IOSChromeControllerClient> controller_;
+ scoped_ptr<security_interstitials::SSLErrorUI> ssl_error_ui_;
+
+ DISALLOW_COPY_AND_ASSIGN(IOSSSLBlockingPage);
+};
+
+#endif // IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
« no previous file with comments | « ios/chrome/browser/ssl/OWNERS ('k') | ios/chrome/browser/ssl/ios_ssl_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698