OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ssl/captive_portal_blocking_page.h" | 5 #include "chrome/browser/ssl/captive_portal_blocking_page.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 | 186 |
187 void CaptivePortalBlockingPage::CommandReceived(const std::string& command) { | 187 void CaptivePortalBlockingPage::CommandReceived(const std::string& command) { |
188 if (command == "\"pageLoadComplete\"") { | 188 if (command == "\"pageLoadComplete\"") { |
189 // content::WaitForRenderFrameReady sends this message when the page | 189 // content::WaitForRenderFrameReady sends this message when the page |
190 // load completes. Ignore it. | 190 // load completes. Ignore it. |
191 return; | 191 return; |
192 } | 192 } |
193 int command_num = 0; | 193 int command_num = 0; |
194 bool command_is_num = base::StringToInt(command, &command_num); | 194 bool command_is_num = base::StringToInt(command, &command_num); |
195 DCHECK(command_is_num) << command; | 195 DCHECK(command_is_num) << command; |
196 // Any command other than "open the login page" is ignored. | |
197 if (command_num == security_interstitials::CMD_OPEN_LOGIN) { | 196 if (command_num == security_interstitials::CMD_OPEN_LOGIN) { |
198 RecordUMA(OPEN_LOGIN_PAGE); | 197 RecordUMA(OPEN_LOGIN_PAGE); |
199 CaptivePortalTabHelper::OpenLoginTabForWebContents(web_contents(), true); | 198 CaptivePortalTabHelper::OpenLoginTabForWebContents(web_contents(), true); |
199 return; | |
200 } | 200 } |
201 ssl_error_ui_->HandleCommand( | |
lgarron
2016/08/31 22:22:31
Is this a passthrough?
(I also don't see `cmd`; d
meacer
2016/08/31 22:38:11
Sigh, I could have at least tried compiling this :
| |
202 static_cast<security_interstitials::SecurityInterstitialCommands>(cmd)); | |
201 } | 203 } |
202 | 204 |
203 void CaptivePortalBlockingPage::OnProceed() { | 205 void CaptivePortalBlockingPage::OnProceed() { |
204 if (cert_report_helper_) { | 206 NOTREACHED() |
205 // Finish collecting information about invalid certificates, if the | 207 << "Cannot proceed through the error on a captive portal interstitial." |
206 // user opted in to. | |
207 cert_report_helper_->FinishCertCollection( | |
208 certificate_reporting::ErrorReport::USER_PROCEEDED); | |
209 } | |
210 } | 208 } |
211 | 209 |
212 void CaptivePortalBlockingPage::OnDontProceed() { | 210 void CaptivePortalBlockingPage::OnDontProceed() { |
213 if (cert_report_helper_) { | 211 if (cert_report_helper_) { |
214 // Finish collecting information about invalid certificates, if the | 212 // Finish collecting information about invalid certificates, if the |
215 // user opted in to. | 213 // user opted in to. |
216 cert_report_helper_->FinishCertCollection( | 214 cert_report_helper_->FinishCertCollection( |
217 certificate_reporting::ErrorReport::USER_DID_NOT_PROCEED); | 215 certificate_reporting::ErrorReport::USER_DID_NOT_PROCEED); |
218 } | 216 } |
219 | 217 |
220 // Need to explicity deny the certificate via the callback, otherwise memory | 218 // Need to explicity deny the certificate via the callback, otherwise memory |
221 // is leaked. | 219 // is leaked. |
222 if (!callback_.is_null()) { | 220 if (!callback_.is_null()) { |
223 callback_.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); | 221 callback_.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); |
224 callback_.Reset(); | 222 callback_.Reset(); |
225 } | 223 } |
226 } | 224 } |
OLD | NEW |