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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.h

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move off the record check before UMA stats collection Created 5 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ 5 #ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_
6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ 6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 12 matching lines...) Expand all
23 } 23 }
24 #endif 24 #endif
25 25
26 class SSLErrorClassification; 26 class SSLErrorClassification;
27 27
28 // This class is responsible for showing/hiding the interstitial page that is 28 // This class is responsible for showing/hiding the interstitial page that is
29 // shown when a certificate error happens. 29 // shown when a certificate error happens.
30 // It deletes itself when the interstitial page is closed. 30 // It deletes itself when the interstitial page is closed.
31 class SSLBlockingPage : public SecurityInterstitialPage { 31 class SSLBlockingPage : public SecurityInterstitialPage {
32 public: 32 public:
33 // These represent the commands sent from the interstitial JavaScript. They 33 // These represent the commands sent from the interstitial
34 // are defined in chrome/browser/resources/ssl/ssl_errors_common.js. 34 // JavaScript. They are defined in
35 // DO NOT reorder or change these without also changing the JavaScript! 35 // chrome/browser/resources/security_warnings/ssl_errors_common.js.
36 // DO NOT reorder or change these without also changing the
37 // JavaScript!
36 enum SSLBlockingPageCommands { 38 enum SSLBlockingPageCommands {
37 CMD_DONT_PROCEED = 0, 39 CMD_DONT_PROCEED = 0,
38 CMD_PROCEED = 1, 40 CMD_PROCEED = 1,
39 CMD_MORE = 2, 41 CMD_MORE = 2,
40 CMD_RELOAD = 3, 42 CMD_RELOAD = 3,
41 CMD_HELP = 4, 43 CMD_HELP = 4,
42 CMD_CLOCK = 5 44 CMD_CLOCK = 5,
45 CMD_DO_REPORT = 6,
46 CMD_DONT_REPORT = 7
Bernhard Bauer 2015/03/03 09:45:59 Add a comma at the end here -- modern compilers wo
estark 2015/03/03 15:36:24 Done.
43 }; 47 };
44 48
45 enum SSLBlockingPageOptionsMask { 49 enum SSLBlockingPageOptionsMask {
46 // Indicates whether or not the user could (assuming perfect knowledge) 50 // Indicates whether or not the user could (assuming perfect knowledge)
47 // successfully override the error and still get the security guarantees 51 // successfully override the error and still get the security guarantees
48 // of TLS. 52 // of TLS.
49 OVERRIDABLE = 1 << 0, 53 OVERRIDABLE = 1 << 0,
50 // Indicates whether or not the site the user is trying to connect to has 54 // Indicates whether or not the site the user is trying to connect to has
51 // requested strict enforcement of certificate validation (e.g. with HTTP 55 // requested strict enforcement of certificate validation (e.g. with HTTP
52 // Strict-Transport-Security). 56 // Strict-Transport-Security).
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 void OverrideEntry(content::NavigationEntry* entry) override; 88 void OverrideEntry(content::NavigationEntry* entry) override;
85 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; 89 void OverrideRendererPrefs(content::RendererPreferences* prefs) override;
86 void OnProceed() override; 90 void OnProceed() override;
87 void OnDontProceed() override; 91 void OnDontProceed() override;
88 92
89 // SecurityInterstitialPage implementation: 93 // SecurityInterstitialPage implementation:
90 bool ShouldCreateNewNavigation() const override; 94 bool ShouldCreateNewNavigation() const override;
91 void PopulateInterstitialStrings( 95 void PopulateInterstitialStrings(
92 base::DictionaryValue* load_time_data) override; 96 base::DictionaryValue* load_time_data) override;
93 97
98 // SecurityInterstitialPageWithExtendedReporting implementation:
99 void PopulateExtendedReportingOption(
100 base::DictionaryValue* load_time_data) override;
101
94 private: 102 private:
95 void NotifyDenyCertificate(); 103 void NotifyDenyCertificate();
96 void NotifyAllowCertificate(); 104 void NotifyAllowCertificate();
97 105
98 std::string GetUmaHistogramPrefix() const; 106 std::string GetUmaHistogramPrefix() const;
99 std::string GetSamplingEventName() const; 107 std::string GetSamplingEventName() const;
100 108
109 // Send a report about an invalid certificate to the server (by
110 // posting a FinishCertCollectionInternal task to the IO thread).
111 void FinishCertCollection();
112
101 base::Callback<void(bool)> callback_; 113 base::Callback<void(bool)> callback_;
102 114
103 const int cert_error_; 115 const int cert_error_;
104 const net::SSLInfo ssl_info_; 116 const net::SSLInfo ssl_info_;
105 // There are two ways for the user to override an interstitial: 117 // There are two ways for the user to override an interstitial:
106 // 118 //
107 // overridable_) By clicking on "Advanced" and then "Proceed". 119 // overridable_) By clicking on "Advanced" and then "Proceed".
108 // - This corresponds to "the user can override using the UI". 120 // - This corresponds to "the user can override using the UI".
109 // danger_overridable_) By typing the word "danger". 121 // danger_overridable_) By typing the word "danger".
110 // - This is an undocumented workaround. 122 // - This is an undocumented workaround.
(...skipping 11 matching lines...) Expand all
122 // Which type of interstitial this is. 134 // Which type of interstitial this is.
123 enum SSLInterstitialReason { 135 enum SSLInterstitialReason {
124 SSL_REASON_SSL, 136 SSL_REASON_SSL,
125 SSL_REASON_BAD_CLOCK 137 SSL_REASON_BAD_CLOCK
126 } interstitial_reason_; 138 } interstitial_reason_;
127 139
128 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); 140 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage);
129 }; 141 };
130 142
131 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ 143 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698