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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
6 #define IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/callback.h"
12 #include "base/macros.h"
13 #include "base/time/time.h"
14 #include "components/certificate_reporting/error_report.h"
15 #include "ios/chrome/browser/interstitials/ios_security_interstitial_page.h"
16 #include "net/ssl/ssl_info.h"
17
18 class IOSChromeControllerClient;
19 class GURL;
20
21 namespace ios {
22 class ChromeBrowserState;
23 }
24
25 namespace security_interstitials {
26 class SSLErrorUI;
27 }
28
29 // This class is responsible for showing/hiding the interstitial page that is
30 // shown when a certificate error happens.
31 // It deletes itself when the interstitial page is closed.
32 class IOSSSLBlockingPage : public IOSSecurityInterstitialPage {
33 public:
34 ~IOSSSLBlockingPage() override;
35
36 // Creates an SSL blocking page. If the blocking page isn't shown, the caller
37 // is responsible for cleaning up the blocking page, otherwise the
38 // interstitial takes ownership when shown. |options_mask| must be a bitwise
39 // mask of SSLErrorUI::SSLErrorOptionsMask values.
40 IOSSSLBlockingPage(web::WebState* web_state,
41 int cert_error,
42 const net::SSLInfo& ssl_info,
43 const GURL& request_url,
44 int options_mask,
45 const base::Time& time_triggered,
46 const base::Callback<void(bool)>& callback);
47
48 protected:
49 // InterstitialPageDelegate implementation.
50 void CommandReceived(const std::string& command) override;
51 void OnProceed() override;
52 void OnDontProceed() override;
53
54 // SecurityInterstitialPage implementation:
55 bool ShouldCreateNewNavigation() const override;
56 void PopulateInterstitialStrings(
57 base::DictionaryValue* load_time_data) const override;
58 void AfterShow() override;
59
60 private:
61 void NotifyDenyCertificate();
62
63 // Returns true if |options_mask| refers to a soft-overridable SSL error.
64 static bool IsOverridable(int options_mask);
65
66 base::Callback<void(bool)> callback_;
67 const net::SSLInfo ssl_info_;
68 const bool overridable_; // The UI allows the user to override the error.
69
70 // The user previously allowed a bad certificate, but the decision has now
71 // expired.
72 const bool expired_but_previously_allowed_;
73
74 scoped_ptr<IOSChromeControllerClient> controller_;
75 scoped_ptr<security_interstitials::SSLErrorUI> ssl_error_ui_;
76
77 DISALLOW_COPY_AND_ASSIGN(IOSSSLBlockingPage);
78 };
79
80 #endif // IOS_CHROME_BROWSER_SSL_IOS_SSL_BLOCKING_PAGE_H_
OLDNEW
« 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